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"?



  • @MagnusF said in Door battery status:

    h to the channel

    did You try sendBatteryLevel function ?



  • @rozpruwacz Thanks!

    That it could be that simple! 😳 Did not see the connection between sending the battery status in the sketch and the thing in openhab.



  • A little off topic but I'm struggling with a same type of scenario. Didnt want to start a new topic if the answer is here.
    The battery I figured out but I'm having problems with the item (contact) and getting it to my sitemap.
    I have checked both files "Contact" in items and "Text" in sitemap (when I add this line the sitemap doesnt load).

    I will post my code if necessary, but can you tell me if a map is always necessary for door contacts? I have other types of sensors working without problems. Should my arduino send only specific words or boolean to make it work?



  • @masmat - I am far from an OpenHAB expert but... The sitemap in OpenHAB is only needed to view the status of (or interact with) the item. It is not required for the functionality of an item or thing itself.

    Have you checked your logs to see if there are clues when OpenHAB parses the things/items filed?

    Please start another thread and post your .things, .items, .sitemap files and a log extract there so we can have a look at them.



  • @masmat No it's not necessary to put the "Contact" in a sitemap, your arduino shall send boolean (0/1).


Log in to reply
 

Suggested Topics

  • 22
  • 4
  • 5
  • 2
  • 135
  • 10

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts