Problems Mqtt and openhab2

1 129 vues
Accéder directement au premier message non lu

Jordi Soley

non lue,
20 avr. 2017, 07:57:3820/04/2017
à SonoffUsers
Hi, 

I have just bought an sonoff th10. I have installed the firmware from github configure the wifi and the mqtt. I have test the sonoff and mqtt recive the signals from status and sensor, but the problem is that I'm unable to switch the relay from openhab and see the temperature. 

I get this from the mqtt sever  :

{
  "Time" : "2017-04-20T12:55:40",
  "DHT22" : {
    "Temperature" : 17.7,
    "Humidity" : 49.1
  }
}

And in openhab items i have the following lines:

Number temp "Temperatura menjador [%.1f °C]"   <temperature>   (gC_Furnace, gTemperature)   { mqtt="<[MQTT:tele/sonoffmenjador/SENSOR:state:JSONPATH($.DTH22.Temperature)]" }
Switch MenjadorI "Interuptor menjador" { mqtt=">[MQTT:cmnd/sonoffmenjador/power:command:*:default], <[MQTT:stat/sonoffmenjador/POWER:state:default]" }

Form the switch I can see that the cmnd/sonoffmenjador/power (ON/OFF) arrives to the mqtt broker but the relay don't do anithing. 

Any one know why this is not working.

Thanks
Le message a été supprimé

Jordi Soley

non lue,
20 avr. 2017, 15:34:3820/04/2017
à SonoffUsers
I Have solved both problems, the first one i didn't have installed the json transformation, and the second one I had changed the sub in arduino code and I didn't remeber.

I hope that this helps some one. 

Thanks!
Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message