trigger Rule via MQTT

Moderators: Voyager, BertB, rtenklooster, Stuntteam, grovkillen, TD-er

Post Reply
Message
Author
henfri
Normal user
Posts: 9
Joined: 26 May 2018, 15:53

trigger Rule via MQTT

#1 Post by henfri » 08 Sep 2018, 16:01

Hello,

I am trying to trigger this rule

Code: Select all

on shpy#HintertuerZiel=1 do
  Publish %sysname%/setze15,1
  gpio,15,1
  delay 100
  gpio,15,0
  delay 500
  gpio,15,1
endon
Via the openhab-mqtt controller.
I use this command:

Code: Select all

mosquitto_pub -h 192.168.177.3 -m "1" -t Hintertuer/shpy/HintertuerZiel

Code: Select all

mosquitto_sub -t "#" -h 192.168.177.3 -v
Hintertuer/shpy/HintertuerZiel 1
Why does that not work?

Greetings,
Hendrik

User avatar
grovkillen
Normal user
Posts: 2240
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: trigger Rule via MQTT

#2 Post by grovkillen » 08 Sep 2018, 16:06

Have you studied the wiki regarding how to trigger commands using MQTT?
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 :idea: :idea: :idea:

henfri
Normal user
Posts: 9
Joined: 26 May 2018, 15:53

Re: trigger Rule via MQTT

#3 Post by henfri » 08 Sep 2018, 16:48

I do not know, which wiki page you refer to.
I studied this one:
https://www.letscontrolit.com/wiki/inde ... rial_Rules
Here, only the opposite direction (espeasy sends) is mentioned.

User avatar
grovkillen
Normal user
Posts: 2240
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: trigger Rule via MQTT

#4 Post by grovkillen » 08 Sep 2018, 21:35

Go to the main page and look for the section "command reference".
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 :idea: :idea: :idea:

henfri
Normal user
Posts: 9
Joined: 26 May 2018, 15:53

Re: trigger Rule via MQTT

#5 Post by henfri » 09 Sep 2018, 12:34

Hello,

thanks. I've been there as well.
On that page I see how to activate/deactivate rules.
But I do not see how to *trigger* a rule.

Do I need to trigger an event for that?

Greetings,
Hendrik

User avatar
grovkillen
Normal user
Posts: 2240
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: trigger Rule via MQTT

#6 Post by grovkillen » 09 Sep 2018, 13:02

Yes, use the event command and send it to the topic ending with "cmd".
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 :idea: :idea: :idea:

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest