@masmat No it's not necessary to put the "Contact" in a sitemap, your arduino shall send boolean (0/1).
Posts made by MagnusF
RE: 💬 Battery Powered Sensors
I am a newbie and have some thoughts about the battery level that I did not find in this forum.
The 8MHz 3.3V Arduino Pro Mini can handle down to roughly 2.8V.
If I have understood the calculations in the sketch correctly then the analog value of A0 is 1023 at 3.44V and 0 at 0V.
This means that at 2.8V the value is about 830 = 83% and under this, the Arduino stops working. Is this right?
If this is correct, I wonder if someone has changed the calculation in the sketch so that the battery percentage becomes 0 at 2.8V?
This would mean that the battery percentage becomes a more real value on the battery level.
Battery Door switch without debounce
I have a battery operated node with a door switch using sleep and no debouncer.
The node seem to work well but I have some thoughts about reliably in my sketch.
The first 2 lines in the "void loop()" is:
wait(50); // Short delay to allow switch to properly settle
value = digitalRead(BUTTON_PIN);
and the last is:
sleep(digitalPinToInterrupt(BUTTON_PIN), CHANGE, SLEEP_TIME);.
As I have understand, when the door e.g. is opened during sleep time the arduino wakes up and starts the loop from the beginning, is this correct?
If so, will "wait (50)" prevent "bouncing"?
RE: Raspberry Pi SD Card wear out?
Perhaps not the best solution but easy for a beginner.
It's possible to use "Win32 Disk Imager" to make an image of the a RPi SD card and save on e.g. Windows PC. Explained here: https://computers.tutsplus.com/articles/how-to-clone-your-raspberry-pi-sd-cards-with-windows--mac-59294
If you make an image, e.g. after changes in openHAB or at selected times, can't this be used to restore the system?
I'm aware of that data colected since the last made image will be lost and the system is down during the process.
Door battery status
I started a few months ago with MySensor and openhab and have now configured a node with a door contact. I'm using a serial gateway connected to a RPi with openhab. The node is registered as Door in openhab and works with the door Open / Closed. The node is powered by battery so I want to report battery status but do not know how to get this to openhab. Have searched the forum but have not found anything.
The Thing Door has in openhab 4 channels:
Tripped Status, mysensors:door 709db93f:door_3_1:tripped, Contact
Armed Status, mysensors:door 709db93f:door_3_1:armed, Switch
Battery Level, mysensors:door 709db93f:door_3_1:battery, Number
Last Update, mysensors:door 709db93f:door_3_1:lastupdate, DateTime
All the channels have the same node id (3) and child id (1) so how shall I send the battey value from the sketch to the channel "Battery Level"?
RE: Problem to program pro mini
I read in another topic your reference to https://www.arduino.cc/en/Tutorial/ArduinoISP on how to burn a bootloader.
Is this an opportunity to get the wrong card to work?
Do you know if the capacitor mentioned in the reference is needed for a Pro Mini?