Trigger an event using Node-Red

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
dynamicdave
Normal user
Posts: 257
Joined: 30 Jan 2017, 20:25
Location: Hampshire, UK

Trigger an event using Node-Red

#1 Post by dynamicdave » 13 May 2017, 15:21

Hi to all,
I've been playing around with "rules" to trigger an event within ESP8266.

Although I can get the rule to trigger by sending the following URL, I can't work out what I should do in Node-Red to achieve the same result.

http://192.168.1.31/control?cmd=event,triggerme

I've pulled out nearly all my hair trying various combinations in Node-Red.
I would appreciate it if anyone can share with me what I should put in the MQTT send node.

Kind regards from David.

pppp33
Normal user
Posts: 71
Joined: 25 Oct 2015, 17:53

Re: Trigger an event using Node-Red

#2 Post by pppp33 » 14 May 2017, 19:54

Hi,
have u considered MQTT ?
If u have NR running, u can easily setup a mosquitto broker in the same machine, then use MQTT pubs in NR and Mqtt import in Espeasy.....
Regards
Paolo

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Trigger an event using Node-Red

#3 Post by papperone » 14 May 2017, 20:28

I think dynamicdave has MQTT as he's asking it how to configure an output MQTT node :)

here it is th answer:

topic = /<ESPEasy module name>/cmd
payload = "event,<event name>"
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

User avatar
dynamicdave
Normal user
Posts: 257
Joined: 30 Jan 2017, 20:25
Location: Hampshire, UK

Re: Trigger an event using Node-Red

#4 Post by dynamicdave » 15 May 2017, 16:17

Thanks for your responses.

I do already have MQTT running on a Raspberry Pi with Node-Red on another RPi.

I'll try out your answer this evening.

Thanks for all your help/advice.

David.

User avatar
dynamicdave
Normal user
Posts: 257
Joined: 30 Jan 2017, 20:25
Location: Hampshire, UK

Re: Trigger an event using Node-Red

#5 Post by dynamicdave » 15 May 2017, 22:46

Thanks for your help.
Your answer works like a "dream" - thanks.

I must have tried loads of combinations in the MQTT syntax but not the one you suggested.

Cheers from DynamicDave
papperone wrote: 14 May 2017, 20:28 I think dynamicdave has MQTT as he's asking it how to configure an output MQTT node :)

here it is th answer:

topic = /<ESPEasy module name>/cmd
payload = "event,<event name>"

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Trigger an event using Node-Red

#6 Post by papperone » 20 May 2017, 23:11

my pleasure to be able to help you :)
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

Post Reply

Who is online

Users browsing this forum: No registered users and 52 guests