Node battery voltage in openHAB iOS
-
Hi all
I have a question regarding this topic :
battery powered arduino without resistors
I have just implemented this in a motion/temp/humidity sensor
-> Arduino Pro Mini with NRF24, DHT22 and SR501 (converted to 3.3V as per "Build" instruction)
I inserted this bit of code into mysensor code :#include <Vcc.h> const float VccExpected = 3.0; const float VccCorrection = 2.860/2.92; Vcc vcc(VccCorrection); void loop() { int batteryPcnt = (int)vcc.Read_Perc(VccExpected); sendBatteryLevel(batteryPcnt); }
I am pretty happy with the result, as i can now see voltage within PaperUI
Now how would i get that in "things", "items" and "sitemap" ? So i can get my node battery voltage in openHAB iOS...
Do I need to create a new child that "carries" this info?Thanks a lot for your help
-
@ben999 : Here's an example how to integrate the battery percent value: https://github.com/tobof/openhab2-addons/wiki/Examples
Look for bathBat01.
-
@TimO saving my evening once more !
I got so much inspiration from that link already... and tonight's solution was there all along!!!
It is now working fine, with icon changing according to voltage changes !!!
Thanks a lot Tim!!
Suggested Topics
-
Boxes and Enclosures
Enclosures / 3D Printing • 29 Mar 2014, 21:02 • PITP2 31 Aug 2014, 19:27 -
OH3, RPi3, GPIO-NRF24 gateway. MySensors binding (ETH or MQTT?)
OpenHAB • 30 Sept 2021, 10:24 • perIpI 1 Oct 2021, 09:19 -
openhab binding mysensors
OpenHAB • 14 Mar 2021, 18:44 • MDS 15 Mar 2021, 21:56 -
voltage sensor via esp and mqtt
OpenHAB • 7 Nov 2020, 09:49 • muhammed 7 Nov 2020, 09:49 -
MQTT losing messages...
OpenHAB • 8 Jul 2022, 11:27 • ben999 17 Jul 2022, 18:00 -
openHAB 4 MySensors Binding
OpenHAB • 1 Aug 2023, 22:19 • ben999 7 Feb 2024, 14:25