EspEasy with openhab and mqtt not working
Moderators: grovkillen, Stuntteam, TD-er
EspEasy with openhab and mqtt not working
Hello,
i try to connect my espeasy devices with openhab. The openhab is on a rpi.
I have install mosquitto and configured it already. I have set the configuration in the espeasy device. I can connect to the mqtt broker and i see the devices there if i make a subscribe over mqttfx.
Now i try to change a pin state first over mqttfx. I make a publish with this command:
/Strassenlicht/GPIO/13:command:ON:1
but it isn't working. On the Esp is the newest espeasy system installed. Over http i can change the gpio pin states. I think my mqtt command is wrong but i couldn't find other commands.
Thanks for your help!
i try to connect my espeasy devices with openhab. The openhab is on a rpi.
I have install mosquitto and configured it already. I have set the configuration in the espeasy device. I can connect to the mqtt broker and i see the devices there if i make a subscribe over mqttfx.
Now i try to change a pin state first over mqttfx. I make a publish with this command:
/Strassenlicht/GPIO/13:command:ON:1
but it isn't working. On the Esp is the newest espeasy system installed. Over http i can change the gpio pin states. I think my mqtt command is wrong but i couldn't find other commands.
Thanks for your help!
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: EspEasy with openhab and mqtt not working
Have you looked into the wiki section regarding commands?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Re: EspEasy with openhab and mqtt not working
Hello,
thanks for your reply! Yes, the http command works fine. I had tried more mqtt commands. From the wiki i think correct is this:
/Strassenlicht/control?cmd=GPIO,13,1
But it doesn't work... Had tried this in mqttfx and this as a openhanded item:
Switch switch1 "Strassenlicht" { mqtt=">[jedyn:Strassenlicht/control?cmd=GPIO,12,1],
<[jedyn:Strassenlicht/control?cmd=GPIO,12,1]" }
nothing works... only http
thanks for your reply! Yes, the http command works fine. I had tried more mqtt commands. From the wiki i think correct is this:
/Strassenlicht/control?cmd=GPIO,13,1
But it doesn't work... Had tried this in mqttfx and this as a openhanded item:
Switch switch1 "Strassenlicht" { mqtt=">[jedyn:Strassenlicht/control?cmd=GPIO,12,1],
<[jedyn:Strassenlicht/control?cmd=GPIO,12,1]" }
nothing works... only http
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: EspEasy with openhab and mqtt not working
I don't know what you're exact topics are that your controller settings is using but this is how you should do it:
topic
message/payload
topic
Code: Select all
Strassenlicht/cmd
Code: Select all
GPIO,12,1
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Re: EspEasy with openhab and mqtt not working
So my mqtt command should be:
Strassenlicht/cmd GPIO,13,1?
This is not working. I had put my config in attachments and my try too
Strassenlicht/cmd GPIO,13,1?
This is not working. I had put my config in attachments and my try too
- Attachments
-
- 15366662476172136408086338399049.jpg (4.38 MiB) Viewed 8530 times
-
- 15366661171008988987924260772376.jpg (4.55 MiB) Viewed 8530 times
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: EspEasy with openhab and mqtt not working
I suggest you do screenshots instead of photos.
You have the following setting /%sysname%/# according to your picture. so the topic should then be:
Please observe that leading front slash!!
And the payload should then be:
Or whatever pin you want to control.
You have the following setting /%sysname%/# according to your picture. so the topic should then be:
Code: Select all
/Strassenlicht/cmd
And the payload should then be:
Code: Select all
GPIO,12,1
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Re: EspEasy with openhab and mqtt not working
/Strassenlicht/cmd GPIO,13,1 is not working and
/Strassenlicht/cmd/GPIO,13,1 isnt working too...
/Strassenlicht/cmd/GPIO,13,1 isnt working too...
-
- Normal user
- Posts: 33
- Joined: 05 Jun 2017, 05:32
Re: EspEasy with openhab and mqtt not working
Format needs to be
topic: /ESP_EASY/cmd
payload: gpio,12,1
Its not clear from your screenshot what the topic is, and what the payload is.
MQTT messages always have a topic and a payload.
For gpio, you can also do this
topic: /ESP00/gpio/12
payload of 0 or 1
It will work, but not recommended, the first way works for any command, the 2nd only works for gpio.
BTW, you should really remove the first "/" from everything (esp side and openhab side), but as long as you are consistent, you have it both places or don't have it both places, it should work.
I also found a mqtt sniffer program to REALLY help figure out mqtt problems. It shows exactly what is being sent.
topic: /ESP_EASY/cmd
payload: gpio,12,1
Its not clear from your screenshot what the topic is, and what the payload is.
MQTT messages always have a topic and a payload.
For gpio, you can also do this
topic: /ESP00/gpio/12
payload of 0 or 1
It will work, but not recommended, the first way works for any command, the 2nd only works for gpio.
BTW, you should really remove the first "/" from everything (esp side and openhab side), but as long as you are consistent, you have it both places or don't have it both places, it should work.
I also found a mqtt sniffer program to REALLY help figure out mqtt problems. It shows exactly what is being sent.
Re: EspEasy with openhab and mqtt not working
okay thanks for your information. I couldn't find much information at the internet and i had tried a lot of possibilities. Can you tell me where i find the information about the topic and the payload? Depent it on the mqttbroker? Or is it in the ESPEasy configuration?
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: EspEasy with openhab and mqtt not working
The topic and payload I suggested should work. Seems like how you're sending the info is the problem. Please use another MQTT client since the one you're using seems a bit vague on how to do things.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
-
- Normal user
- Posts: 33
- Joined: 05 Jun 2017, 05:32
Re: EspEasy with openhab and mqtt not working
You really should get a mqtt sniffer
https://www.hivemq.com/blog/seven-best- ... ient-tools
It will take a few minutes to figure out how to setup and get it working, but it makes it SO much easier when you can actually see what's going on.
And you can use them to send stuff too.
I've used both mqtt.fx and mqttlens from the list above, and they both work fine for helping to debug mqtt problems.
https://www.hivemq.com/blog/seven-best- ... ient-tools
It will take a few minutes to figure out how to setup and get it working, but it makes it SO much easier when you can actually see what's going on.
And you can use them to send stuff too.
I've used both mqtt.fx and mqttlens from the list above, and they both work fine for helping to debug mqtt problems.
Who is online
Users browsing this forum: No registered users and 67 guests