Controll a relay using cmd and gpio from Node Red
Moderators: Voyager, BertB, grovkillen, Stuntteam, LisaM
Controll a relay using cmd and gpio from Node Red
I have configured EspEasy on a generic ESP8266 card, and want to use Node Red and MQTT to switch a relay of an on.
I have set up the following in EspEasy:
Unit Name: Realy_Meaco
Unit Number 1
Controller Domoticz MQTT
Controller Subscribe: Relay_Meaco_1/#
Controller Publsih: Relay_Meaco_in
Devices: Input Switch at GPIO 12
Running GPIO,12,1 and GPIO,12,0 from the command line in EspEasy turns the swithc of an on, and sends information about this back to Node Red via RalayMeaco/in
In Node red I use Mqtt in and Mqtt out to comunicate with EspEasy:
Mqtt in: Topic: Relay_Meaco_1/in
Mqtt out: Topic: Relay_Meaco_1/cmd
I have two injection nodes trying to send the following: gpio,12,1 and gpio,12,0 to Mqtt out, but nothing happens. If I manually run the commands from the comman consoll in EspEasy, Mqtt in will report back the result.
I am sure there is something I have missed, because I had this up and running two weeks ago, but I blew the Esp8266, so I am no using another, and I cannot remember exactly how I didi it.
All the best from
Ulf
I have set up the following in EspEasy:
Unit Name: Realy_Meaco
Unit Number 1
Controller Domoticz MQTT
Controller Subscribe: Relay_Meaco_1/#
Controller Publsih: Relay_Meaco_in
Devices: Input Switch at GPIO 12
Running GPIO,12,1 and GPIO,12,0 from the command line in EspEasy turns the swithc of an on, and sends information about this back to Node Red via RalayMeaco/in
In Node red I use Mqtt in and Mqtt out to comunicate with EspEasy:
Mqtt in: Topic: Relay_Meaco_1/in
Mqtt out: Topic: Relay_Meaco_1/cmd
I have two injection nodes trying to send the following: gpio,12,1 and gpio,12,0 to Mqtt out, but nothing happens. If I manually run the commands from the comman consoll in EspEasy, Mqtt in will report back the result.
I am sure there is something I have missed, because I had this up and running two weeks ago, but I blew the Esp8266, so I am no using another, and I cannot remember exactly how I didi it.
All the best from
Ulf
Re: Controll a relay using cmd and gpio from Node Red
Domoticz MQTT + switch...
So my Pavlov reply is to link to this part of the documentation: https://espeasy.readthedocs.io/en/lates ... #p029-page
Have you followed those steps?
So my Pavlov reply is to link to this part of the documentation: https://espeasy.readthedocs.io/en/lates ... #p029-page
Have you followed those steps?
Re: Controll a relay using cmd and gpio from Node Red
Thank you so much for the suggestion, but this is not the way I made it work a few weeks ago, and the solution you provide is much more complicated. I did not use rules, I just sent the command GPIO,12,1 but there must be something wrong with my syntax, since nothing happens.
Best regards
Ulf
Best regards
Ulf
Re: Controll a relay using cmd and gpio from Node Red
Are you sure you used the Domoticz MQTT controller?
When using the "cmd" syntax in topics, I think you used the OpenHAB controller.
When using the "cmd" syntax in topics, I think you used the OpenHAB controller.
Re: Controll a relay using cmd and gpio from Node Red
Yes, absolutely sure. Recon there is something wrong with the settings on the ESP8266, since I had no problems making it work using Tasmota, but I would rather use EspEasy
Re: Controll a relay using cmd and gpio from Node Red
The Domoticz MQTT controller does not look at the topic ending with "cmd"
That's the OpenHAB MQTT controller.
If you don't use Domoticz, I guess using the OpenHAB MQTT controller is a bit more flexible as it does allow for some more (not very elaborate though) commands via MQTT.
What is configured in Node Red to publish to that topic?
Maybe depending on the syntax of the exact message we can determine which controller you probably used and also if you're missing something.
That's the OpenHAB MQTT controller.
If you don't use Domoticz, I guess using the OpenHAB MQTT controller is a bit more flexible as it does allow for some more (not very elaborate though) commands via MQTT.
What is configured in Node Red to publish to that topic?
Maybe depending on the syntax of the exact message we can determine which controller you probably used and also if you're missing something.
Re: Controll a relay using cmd and gpio from Node Red
I think we might be talking past each other.
My MQTT broker is Mosquitto, running on a Raspberry pi, and I am chosing Domoticz Mosquitto on ESPEasy. I will try to use one of the other options, and see if that changes the result.
My MQTT broker is Mosquitto, running on a Raspberry pi, and I am chosing Domoticz Mosquitto on ESPEasy. I will try to use one of the other options, and see if that changes the result.
Re: Controll a relay using cmd and gpio from Node Red
I owe TD-er a beer! Changed to OpenHAB, and worked stright out of the box!
Thank you so much!
All the best from
Ulf
Thank you so much!
All the best from
Ulf
Who is online
Users browsing this forum: No registered users and 2 guests