Shelly 1 relay in nodered?

Hello I need your help, I want to install a Shelly 1 relay in nodered which is controllable with homekit, but I can't, look at my screenshots of my flow, can you tell me what I need to modify ?

Hi & welcome to the forum.

First things first with node-red - use debug nodes to see what message is travelling down the wires & verify what is coming out of / going into each node is what you expect.

Second thing - read the built in help for a node (there is often sample code)...

Third tip, start small. E.g. use inject nodes to get things going before you try to hook up 2 systems.


Demo flow (used CTRL+I to import)

[{"id":"d4c4c1dd.3a07c","type":"inject","z":"5e6c8b.7f38b374","name":"turn on","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{ \"relay\" : 0, \"on\" : true }","payloadType":"json","x":98,"y":544,"wires":[["53d5e208.3502ac"]]},{"id":"22373c66.a0eb74","type":"inject","z":"5e6c8b.7f38b374","name":"turn off","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{ \"relay\" : 0, \"on\" : false }","payloadType":"json","x":98,"y":576,"wires":[["53d5e208.3502ac"]]},{"id":"4bed432d.addeec","type":"inject","z":"5e6c8b.7f38b374","name":"status","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"str","x":98,"y":608,"wires":[["53d5e208.3502ac"]]},{"id":"53d5e208.3502ac","type":"shelly-switch","z":"5e6c8b.7f38b374","hostname":"","description":"","x":342,"y":608,"wires":[["9d407f28.db5ad"]]},{"id":"9d407f28.db5ad","type":"debug","z":"5e6c8b.7f38b374","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":514,"y":608,"wires":[]}]

And a 4th tip, if you are happy not to use Shelly Cloud, turn on MQTT support and then it all is a lot easier.

Bonus tip: You don't really seem to gain much if anything from the Shelly node, you could do everything just about as easily using the core http-request node.

I was under the impression that node uses the built in http API (not cloud services)

It's a good idea but I don't want to lose the cloud function of the shelly app

Misunderstanding. The HTTP API is available directly, you don't really need the node. But to use MQTT with the Shelly, you have to turn off Shelly cloud.

1 Like

How should I proceed then and with what mqtt or node red? ?

As you want to retain Shelly cloud, you cannot use MQTT.

Follow Steve's guide and let us know what output you are getting.

Yes great it works thank you very much my light turns on and off on the other hand how now I can add homekit?

So attach debug nodes to every output and look at what is in the msg for the working flow & make your flow send a similar message. Clue... Use a switch node to direct your on/off commands. Use a change node to generate the correct command (which is essentially copying what I put in the inject nodes).

it's too complicated for me, I would just like to add the homekit node to your example which works

Show me what comes out of this homekit node & explain what would make the light come on & what would make it go off.

I don't know where to place homekit in the flow of node red

I have no idea. I don't own any Apple products.

There seems to be a huge amount of info on their wiki. I would start there.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.