MySensors 2.0: can't get openhab item definition



  • Hi,
    I'm running openhab 1.8.3 and a mys-mqtt gatway (Version1.5). Everything works fine, but I want to upgrade to MySensors 2.0.
    I built the raspberry mys-mqtt gateway version 2.0, which seems to work fine, as it finds some of my sensors. At the moment I'm not sure, why it doesn't see all sensors, might be because of the small antenna.
    The question is: how do the openhab items have to be defined.
    The gateway shows this output for my pressure sensor:

    mysGateway: Sending message on topic: MyMQTT/0/255/0/0/18
    mysGateway: TSF:MSG:READ,27-27-0,s=5,c=1,t=4,pt=7,l=5,sg=0:1026
    mysGateway: Sending message on topic: MyMQTT/27/5/1/0/4
    mysGateway: Message arrived on topic: MyMQTT/27/5/1/0/4
    mysGateway: TSF:MSG:SEND,0-0-27-27,s=5,c=1,t=4,pt=0,l=4,sg=0,ft=0,st=OK:1026
    
    

    The mosquitto shows me:

    MyMQTT/27/5/1/0/4 1026
    

    The corrsponding openhab item (which works for my mqtt gateway version 1.5) looks like:

    Number node27_pressure	"Luftdruck [%.1f hPa]"	<sensor>  (gMySensors,gInfluxDB)	{mqtt="<[mysensor:MyMQTT/27/5/V_PRESSURE:state:default]"}
    

    I fear, this old item definition isn't compatible with mysensors 2.0 any more, right?
    Regarding to the documentation and the mqtt message I think the mqtt-part in the items definition needs to be changed. Is there already a documentation available?

    My assumption is for MyMQTT/27/5/1/0/4
    27= nodeID (obvious)
    5 = sensorID (obvious, too)
    1 = message-type (set), when do I need req?
    0 = ack (no idea, what this is for)
    4 = variable definition (4=V_PRESSURE)

    Provided, my assumtion is correct: when do I need to use set and req (message-type). Which value do I need for ack?
    I also have items, which send commands from openhab to actuator, like

    Switch node24_sw0	"Schalter Ringleitung" 	<socket> (gMySensors,gInfluxDB,gAbstellkammer)	{mqtt=">[mysensor:MyMQTT/24/0/V_LIGHT:command:ON:1],>[mysensor:MyMQTT/24/0/V_LIGHT:command:OFF:0]"}
    

    How do I need to set the mqtt part than?

    Thanks for every tipp!



  • Is nobody using openhab 1 in combination with MySensors2.0?



  • You need to change the MQTT topics in the OpenHab MQTT config.

    MYS 2.0 is publishing data to this topic.

    MyMQTT/27/5/1/0/4
    

    However openhab is subscribing to this topic.

    MyMQTT/27/5/V_PRESSURE
    

    Hope this helps.


Log in to reply
 

Suggested Topics

  • 22
  • 19
  • 7
  • 132
  • 1
  • 4

0
Online

11.2k
Users

11.1k
Topics

112.5k
Posts