cbirchy87
(Chris Birch)
November 30, 2017, 1:29pm
1
Hi. I’ve bee having issue with my config file.
I currently have a Nodemcu using ESPEASY with a led connected to GPIO 14. I can run the web command from my browser http://192.168.0.31/control?cmd=GPIO,14,1Which turns the led on.
I need help setting up a switch in HA. When i connect my nodemcu and view the comm log it says its connected to my brooker, which is my RPI running HA. its says connected /mcu/#. mcu being the name of my nodemcu.
What would be command and state information be? This is the last issue i need to overcome.
After this i want HA to know if that switch is on or off. I am now sure how i would go about this.
Thanks!!!
gpbenton
(Graham)
November 30, 2017, 2:30pm
2
A quick search of the forum revealed a number of results. This seemed to be a good answer
That part is actually pretty easy. Simply name your switches uniquely or follow the guide here for defining the best layout approach. As my yaml is small at the moment, I’m using the following:
switch 4:
platform: mqtt
name: "Sonoff4"
state_topic: "/sonoff4/relay/state"
command_topic: "/sonoff4/gpio/12"
payload_on: "1"
payload_off: "0"
qos: 1
retain: true
switch 5:
platform: mqtt
name: "Sonoff5"
state_topic: "/sonoff5/relay/state"
command_topic: "/sonoff5/gpio/12"
pa…
cbirchy87
(Chris Birch)
November 30, 2017, 2:35pm
3
That looks like it makes sense!
Thank you!
cbirchy87
(Chris Birch)
November 30, 2017, 8:26pm
4
still not working for me. placed this in my config
switch 4:
platform: mqtt
name: “mcu”
state_topic: “/mcu/relay/state”
command_topic: “/mcu/gpio/14”
payload_on: “1”
payload_off: “0”
qos: 1
retain: true
Still doesn’t change state.
http://192.168.0.31/control?cmd=GPIO,14,0
http://192.168.0.31/control?cmd=GPIO,14,1
Does change the state, please help
cbirchy87
(Chris Birch)
November 30, 2017, 9:31pm
5
look like ive got it working.