ESPeasy switch not working with OpenHab MQTT

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
ronvsanten
New user
Posts: 2
Joined: 28 Feb 2017, 09:50

ESPeasy switch not working with OpenHab MQTT

#1 Post by ronvsanten » 02 Mar 2017, 04:40

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 5516 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 5516 times
Cheers,
Ron.

paxi
Normal user
Posts: 121
Joined: 02 Feb 2017, 00:48
Location: Germany

Re: ESPeasy switch not working with OpenHab MQTT

#2 Post by paxi » 02 Mar 2017, 07:18

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. ;)

ronvsanten
New user
Posts: 2
Joined: 28 Feb 2017, 09:50

Re: ESPeasy switch not working with OpenHab MQTT

#3 Post by ronvsanten » 02 Mar 2017, 09:47

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

paxi
Normal user
Posts: 121
Joined: 02 Feb 2017, 00:48
Location: Germany

Re: ESPeasy switch not working with OpenHab MQTT

#4 Post by paxi » 02 Mar 2017, 10:28

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

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 19 guests