Page 1 of 1

ESPeasy switch not working with OpenHab MQTT

Posted: 02 Mar 2017, 04:40
by ronvsanten
Hi,

I'm trying to get my Sonoff, flashed with ESPeasy, to turn on and off.

I'm a NOOB with this and can't figure out what I'm doing wrong.
OpenHabian2 and MQTT on RPi 3, a Sonoff with ESPeasy.

In OpenHab items:
Switch Sonoff1 {mqtt=">[mymosquitto:/Sonoff_1/gpio/12:command:ON:1],>[mymosquitto:/Sonoff_1/gpio/12:command:OFF:0]"}
will let me turn on and off the Sonoff in OpenHab. (using gpio/12)

But if I set up the ESPeasy as follows:
ESPeasy_Device.png
ESPeasy_Device.png (89.23 KiB) Viewed 5514 times

and the item as:
Switch Sonoff1 {mqtt=">[mymosquitto:/Sonoff_1/SonoffSwitch/Command:command:ON:1],>[mymosquitto:/Sonoff_1/SonoffSwitch/Command:command:OFF:0]”}

Then I can't turn the Sonoff On or Off. (using "SonoffSwitch/Command" instead of "gpio/12")

I have the same issue with a NodeMCU (ESPeasy) and a LED, so I must be doing something wrong, but I just don't see it.
Any help appreciated.
FYI, here the main page setup as info:
ESPeasy_main.png
ESPeasy_main.png (71.85 KiB) Viewed 5514 times
Cheers,
Ron.

Re: ESPeasy switch not working with OpenHab MQTT

Posted: 02 Mar 2017, 07:18
by paxi
Take a look at the command reference:

GPIO (pinnumber),(value) is a command,
(devicename) (valuename),(value) is not - it is a sensor which sends its value back to the broker.

If you want to use something less cryptic in Openhab then wrap the gpio command in a rule and call that via mttq. ;)

Re: ESPeasy switch not working with OpenHab MQTT

Posted: 02 Mar 2017, 09:47
by ronvsanten
paxi wrote:Take a look at the command reference:

GPIO (pinnumber),(value) is a command,
(devicename) (valuename),(value) is not - it is a sensor which sends its value back to the broker.

If you want to use something less cryptic in Openhab then wrap the gpio command in a rule and call that via mttq. ;)
Like I said I'm a Newbie and have to digest this for a moment, but basically you say that I'm using an "Input/read reference setup" for an "Output (On/Off or value) reference setup" and that's why this doesn't work.
(Not sure if I just made it clearer or 'clear as mud' with that statement :-) )
So I AM doing this wrong :(
Ah well... one learns something new every day.

Thanks paxi

Re: ESPeasy switch not working with OpenHab MQTT

Posted: 02 Mar 2017, 10:28
by paxi
If you see input/output in the above statement from the broker's perspective that's right. ;)
Always a joy to let these little lightbulbs glow in other peoples mind. :D