mqtt cant receive gpio command
Moderators: grovkillen, Stuntteam, TD-er
-
- Normal user
- Posts: 33
- Joined: 05 Jun 2017, 05:32
Re: mqtt cant receive gpio command
Update in case someone finds this in a search looking for help.
I changed out the wemos d1 pro with a wemos d1, and loaded it via my macbook with a mid july verion of esp easy.
This worked, when sending via mqtt:
topic: /ESP00/gpio/12
payload of 0 or 1
But if I tried something like pulse or pcfgpio instead of gpio, it did not work
But if you use
topic: /ESP_EASY/cmd
payload: gpio,12,1
Then you can change out gpio with pulse, pcfgpio and it works fine.
So using cmd is safer as it seems to support any valid command you would want to use.
Randy
I changed out the wemos d1 pro with a wemos d1, and loaded it via my macbook with a mid july verion of esp easy.
This worked, when sending via mqtt:
topic: /ESP00/gpio/12
payload of 0 or 1
But if I tried something like pulse or pcfgpio instead of gpio, it did not work
But if you use
topic: /ESP_EASY/cmd
payload: gpio,12,1
Then you can change out gpio with pulse, pcfgpio and it works fine.
So using cmd is safer as it seems to support any valid command you would want to use.
Randy
Re: mqtt cant receive gpio command
Got it working now !!!
The missing part for me was just this
Topic:
ESP_Easy/gpio/15
Message:
1
So now my Homey can post when a motion sensor is active and switch the diods on and when the zone is not active its turn the led off.
Here is how i looks in Homey and also a test it, when doorbell is pressed turn led on
The missing part for me was just this
Topic:
ESP_Easy/gpio/15
Message:
1
So now my Homey can post when a motion sensor is active and switch the diods on and when the zone is not active its turn the led off.
Here is how i looks in Homey and also a test it, when doorbell is pressed turn led on
- Attachments
-
- mqtt_1.JPG (33.86 KiB) Viewed 16807 times
Re: mqtt cant receive gpio command
If crucial information is missing in the documentation, please let me know, or create a pull request with the suggested improvements
See https://espeasy.readthedocs.io/en/lates ... #c014-page
See https://espeasy.readthedocs.io/en/lates ... #c014-page
Re: mqtt cant receive gpio command
The docs page referes to the homie convention controller. The mqtt topic for gpio here is defined as:
Code: Select all
homie/%unitName%/SYSTEM/gpio#/set
Changes on the gpio port are sent from ESPEasy to
Code: Select all
homie/%unitName%/SYSTEM/gpio#
Re: mqtt cant receive gpio command
Is that something that has to be changed in the software or in the documentation? (I'm not the author of the Homie controller)
Re: mqtt cant receive gpio command
I am
Nothing to be changed. If somebody uses the homie controller they have to stick with the homie convention. As described. It can do the Job and I use it in several devices - even without a homie compatible controller. You just have to stay with the naming convention like starting with home/ and the prefix /set for altering parameters.
I was wondering why you mentioned C014 because above the Mqtt-import plugin was mentioned. I just wanted to make sure to point out the difference. Sorry for the misunderstanding.
Chris.
BTW the ? Button on the configuration page is not referring to the correct documentation page ... have to find out why.
Nothing to be changed. If somebody uses the homie controller they have to stick with the homie convention. As described. It can do the Job and I use it in several devices - even without a homie compatible controller. You just have to stay with the naming convention like starting with home/ and the prefix /set for altering parameters.
I was wondering why you mentioned C014 because above the Mqtt-import plugin was mentioned. I just wanted to make sure to point out the difference. Sorry for the misunderstanding.
Chris.
BTW the ? Button on the configuration page is not referring to the correct documentation page ... have to find out why.
Re: mqtt cant receive gpio command
And he couldn’t use C014 because it is in the develop build and not in the normal one (I think)
Re: mqtt cant receive gpio command
Feels like I am forever asking questions on old threads... apology if this has been answered elsewhere.
My situation... I have several NodeMCU units running Mega and communicating with Mosquito MQTT, with Node Red capturing information and forwarding to Blynk app. A one way information transfer.
I want to make it a two way, but for the life of me I cannot work out how to have Node Red send a MQTT message to tell one of my NodeMCU units to start the air conditioner. Here's my rules code...
On StartHP Do
If [counter#status]=0
heatpumpir,daikin,1,3,0,24,4,2
TaskValueSet 4,1,1
EndIf
EndOn
As you can see I have an event that transmits the IR commands to my air conditioner. What I would like to do is have Node Red send a message via MQTT to the NodeMCU to execute the StartHP event i.e. turn on the AC.
I read this thread and others, but am still in the dark about where to put the topic info and which string to use... Here's what I have been trying to use:
I create an inject in Node Red with the topic as the payload... ESP_EASY/event/StartHP
Node Red gave me back the error "Invalid topic specified" which tells me I am not entering the data in the right format? Any advice greatly appreciated, I have no doubt it will be my lack of knowledge getting in the way.
Thanks, Grego
My situation... I have several NodeMCU units running Mega and communicating with Mosquito MQTT, with Node Red capturing information and forwarding to Blynk app. A one way information transfer.
I want to make it a two way, but for the life of me I cannot work out how to have Node Red send a MQTT message to tell one of my NodeMCU units to start the air conditioner. Here's my rules code...
On StartHP Do
If [counter#status]=0
heatpumpir,daikin,1,3,0,24,4,2
TaskValueSet 4,1,1
EndIf
EndOn
As you can see I have an event that transmits the IR commands to my air conditioner. What I would like to do is have Node Red send a message via MQTT to the NodeMCU to execute the StartHP event i.e. turn on the AC.
I read this thread and others, but am still in the dark about where to put the topic info and which string to use... Here's what I have been trying to use:
I create an inject in Node Red with the topic as the payload... ESP_EASY/event/StartHP
Node Red gave me back the error "Invalid topic specified" which tells me I am not entering the data in the right format? Any advice greatly appreciated, I have no doubt it will be my lack of knowledge getting in the way.
Thanks, Grego
Re: mqtt cant receive gpio command
In an effort to tie this off, I managed to find a solution... which once found appeared embarrassingly simple. In an effort to share information for those of you that are stuck like me here is what I found.
Here is the NodeRed inject node I created to simulate a command to start the air conditioner... You will see the Payload contains the word "event" and the command to "StartHP" which starts the air conditioner. The Topic line contains the ESPEasy hostname (GregoInc1) followed by a forward slash and "cmd" which signifies the use of a command.
And here is the NodeRed MQTT out node, which as you will see is really simple. Hope this helps.
Here is the NodeRed inject node I created to simulate a command to start the air conditioner... You will see the Payload contains the word "event" and the command to "StartHP" which starts the air conditioner. The Topic line contains the ESPEasy hostname (GregoInc1) followed by a forward slash and "cmd" which signifies the use of a command.
And here is the NodeRed MQTT out node, which as you will see is really simple. Hope this helps.
Who is online
Users browsing this forum: No registered users and 30 guests