MQTT Publish Problem

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Rampler
Normal user
Posts: 95
Joined: 31 Dec 2016, 07:13

MQTT Publish Problem

#1 Post by Rampler » 25 Aug 2022, 19:43

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

User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: MQTT Publish Problem

#2 Post by Ath » 25 Aug 2022, 20:52

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.
/Ton (PayPal.me)

Rampler
Normal user
Posts: 95
Joined: 31 Dec 2016, 07:13

Re: MQTT Publish Problem

#3 Post by Rampler » 25 Aug 2022, 21:17

@Ath
You made my day !!
Switch to "Home Assistant (openHAB) MQTT" was the solution !!

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

User avatar
Ath
Normal user
Posts: 3519
Joined: 10 Jun 2018, 12:06
Location: NL

Re: MQTT Publish Problem

#4 Post by Ath » 25 Aug 2022, 22:07

Great that it's solved.
You're welcome ;)
/Ton (PayPal.me)

Post Reply

Who is online

Users browsing this forum: No registered users and 112 guests