I hope that someone can help me in what should be a simple problem.
I am trying to control a Shelly Plus 1PM switch with Node Red over MQTT. The Node Red Flow is very simple at this time. Several Inject Nodes to input an Off, On and Toggle commands. All I want this simple flow to do is to turn the snitch On and Off.
I have MQTT Explorer up and running. I have the switch configured to work on my local network with its own IP address.
I logged into the Web interface for the device and set the name to 'shellies/shellyplus1pm-90380c36f9e4'.
If I log into the switch directly on its IP address, I can turn it off and on. When I click on the on-screen button for off/on, MQTT Explorer shows this action. It reports shellies/shellyplus1pm-90380c36f9e4 debug, events, and status. This is normal and good.
I can also control the switch via http commands to the ip of the switch.
My Node Red flow is quite simple: three inject nodes for Off, On and Toggle, and a MQTT out node to transmit the signals.
I found the following documentation:
Shelly1/1PM: MQTT
Shelly1 and Shelly1PM uses the following topics, where <model>
is either shelly1
or shelly1pm
:
shellies/<model>-<deviceid>/relay/0
to report status:on
,off
oroverpower
(the latter only for Shelly1PM)shellies/<model>-<deviceid>/relay/0/command
acceptson
,off
ortoggle
and applies accordinglyshellies/<model>-<deviceid>/input/0
reports the state of theSW
terminalshellies/<model>-<deviceid>/longpush/0
reportslongpush
state as0
(shortpush) or1
(longpush)shellies/<model>-<deviceid>/input_event/0
reports input event and event counter, e.g.:{"event":"S","event_cnt":2}
see/status
for details
This document seems to suggest that I should be able to send to "
shellies/<model>-<deviceid>/relay/0/command"
value 'on' to turn the relay on, and 'off' to turn the relay off. What I get in debug is that the command 'on' is not a recognized MQTT command.
I will happily post any and all screen shot of the MQTT Explorer screens and the Node Red debug reports. Fundamentally, it seems that the documentations suggest that I can send to topic shellies/shellyplus1pm<my device id>/command the msg 'on' and the relay should turn on. MQTT Explorer reports that the msg command = on is received, but the Node Red debug reports that the command 'on', is not a MQTT recognized command.
I am not a programmer by trade or experience. Any help would be appreciated.
I will be happy to post any screen shot or anything else asked for. I have not found any other post that seems to work.