Page 1 of 1

MQTT Publish Problem

Posted: 25 Aug 2022, 19:43
by Rampler
Hi guys,

i want to switch a GPIO via MQTT. (The GPIO is only used in rules)
Switch the GPIO via http is working fine:
http://Heizraum-ESP/control?cmd=GPIO,4,1

Switch via MQTT does not work:
mosquitto_pub -d -t /Heizraum-ESP/GPIO/4 -m 1

The device reports already some values to my MQTT Server.

Controller settings are:
subscribe: /Heizraum-ESP/#
pubish: /Heizraum-ESP/%valname%

I use rules for publish data to my server:

Code: Select all

on GPIO#4=1 do
 publish /Heizraum-ESP/Pumpe,1
endon
on GPIO#4=0 do
 publish /Heizraum-ESP/Pumpe,0
endon
What do i wrong ?

EDIT:
I use PiDome MQTT as a Controller

Re: MQTT Publish Problem

Posted: 25 Aug 2022, 20:52
by Ath
The documentation for the HA MQTT controller has some nice examples/explanation. That will most likely help you out.

I don't think the PiDome controller will work like that.

Re: MQTT Publish Problem

Posted: 25 Aug 2022, 21:17
by Rampler
@Ath
You made my day !!
Switch to "Home Assistant (openHAB) MQTT" was the solution !!

THANKS !!!! :D :D :D :D

Re: MQTT Publish Problem

Posted: 25 Aug 2022, 22:07
by Ath
Great that it's solved.
You're welcome ;)