Im trying to get the last configured, before implementing a lot of Sonoff devices to my home, and I have finally made it controllable over Wifi from Openhab through MQTT, and it works fine…
But! My initial state isnt working, so if I for instance use a switch, which also have a physical on/off, my interface dont take care (So I can power on a device through IOS homekit, if I then power it off, using the physical switch, it doesnt tell homekit that its off.
I think my problem is just something in the “state” command, but I dont really know why…
-That said: My Rules file is empty, my only plan is to get Openhab to get commands from homekit, and then do the programming in homekit. -I dont know if this is possible, but who shouldnt it?
…and surfing the forum, I tried the mapping, but still dont get response on manual switch when my Items file is like this:
Switch Switch1 “Blæser” (gBlower) [ “Lighting” ]
{
mqtt="
Sorry for slow response, had a busy weekend…
Firstly: Its fun how the Quotation marks you make, dont work on my RPI (need to transform them to " before it goes)
-But I still have some issues getting it to read the state…
Works like a Charm, thanks both for helping me adress the error, I think I learned something about how to transform a signal to something usefull in Openhab!
Well, now im into a new problem…
I have bought some other ESP8266 Goodies, and got them working through MQTT…
But! Again: I cant read the state of the item.
The one working looks like this: (The message the ESP send to MQTT)
Topic: Sonoffb1/stat/POWER
and message: ON
My state reading text looks like this:
{mqtt=">[broker:sonoffb1/cmnd/power:command:*:default], <[broker:sonoffb1/stat/POWER:state:default]"}
The new one looks like:
Topic sonoff2/RESULT
and message: {“POWER”:“ON”}
How do I have to change the state, so it knows it only have to look after the things written after "{"POWER: ??