Evaluation: MQTT triggers Outputs

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Sig Pam
New user
Posts: 3
Joined: 06 Apr 2023, 13:23

Evaluation: MQTT triggers Outputs

#1 Post by Sig Pam » 06 Apr 2023, 13:27

Hi Community,

I'm new to ESPEasy and evaluate if it might be the right platform for me.

Is it possible to subscribe to an MQTT topic located on ioBroker and switch output values depending on the value?

Use case: I want to switch an electromagnetic relay depending on the on/off value of the MQTT-topic. Ideally I'd like to control more than one output this way.


Is it possible?

Thank you

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

Re: Evaluation: MQTT triggers Outputs

#2 Post by Ath » 06 Apr 2023, 19:55

You can use the MQTT Import plugin (docs) to do that.
/Ton (PayPal.me)

Sig Pam
New user
Posts: 3
Joined: 06 Apr 2023, 13:23

Re: Evaluation: MQTT triggers Outputs

#3 Post by Sig Pam » 07 Apr 2023, 07:29

OK, thank you. I'll give it a shot.

Sig Pam
New user
Posts: 3
Joined: 06 Apr 2023, 13:23

Re: Evaluation: MQTT triggers Outputs

#4 Post by Sig Pam » 07 Apr 2023, 07:55

Again, Thank you. It works even easier using the HomeAssistent (openHAB) MQTT Controller to directly address GPIO Pins, as documented https://espeasy.readthedocs.io/en/lates ... #c005-page.

To do so, I had to configure the parameter "controller subscribe" with the value "%sysname%/Pumpe/GPIO/4". Setting the value of %sysname%/Pumpe/GPIO/4 on the message broker to 1 or 0 sets the GPIO4 accordingly.

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Evaluation: MQTT triggers Outputs

#5 Post by TD-er » 07 Apr 2023, 10:38

You can also give direct commands via MQTT as described in the docs for C005 you linked.

For example to trigger an event in the rules with some eventvalue(s) and act on them via the rules.

This way you can define a complete sequence of actions to be performed via a single message.
Like starting a timer to later turn off something.
Or send out a number of pulses using the longpulse command (see also the longpulse_ms for times in msec)

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 30 guests