Add run scene/enable/disable to eWeLink Cube Node Red

Sometimes different features are available to scenes that are built into the iHost. For example, currently you can turn a TRV to manual mode at a certain temperature with a scene but there are no effectors in the eWeLink palette on Node Red and you can’t trigger any scene in Node Red. The only way to bypass this currently is to use a spare physical device and turn it of it on in Node Red and use that as the trigger for an automatic scene on the iHost, which is pretty stupid to be honest.

The ability to trigger a smart scene from Node Red would be useful. I slowly migrated all my smart scenes from eWeLink App to iHost, but scenes depending on sunrise/sunset is not yet supported. So I built a flow in Node Red which works well for controlling lights around sunset, but now I find that it works for all my devices except for the Sonoff DualR3. The Node Red control device throws an error basically saying it does not know the device. To get around this I either have to build a second smart scene triggered by one of the other devices, or wait for proper support for the DualR3 in Node Red.
Some posts suggest to do ALL smart scenes in Node Red, but I want to keep things a little more simple to make support easier when I am not around. Smart scenes are easier to maintain for the less technical person, so it would be cool to be able to trigger them from Node Red :slight_smile:

I found a way to do this and to communicate between Node Red and the inbuilt scenes and in reverse.

You can create a virtual switch in Node Red and then use it to communicate between Node Red and the inbuilt scenes where it also appears.

There is a you tube explanation from eWeLink into how to create a virtual device. Just beware that one step is to create a unique identifier for the virtual device: occasionally it won’t like it and the device will be offline all the time. Just create a new unique identifier. Their support will say it is because the node Red you literally just used was off, the IP of your iHost (which should be static anyway) changed or the website provided identifier isn’t unique: don’t argue. Just create a new one. One day they will find the bug.

Thank you for this. I created a virtual device, which I control in a NodeRED flow linked to sunset and sunrise. I then use the virtual device state in a smart scene to trigger the outside lights (including the problem child - the DualR3 :-)). It is working well in test mode - let us see what happens tonight when I am not watching it. Here is the very simple NodeRED flow, if it helps anyone. I use the eztimer node for sunset and sunrise:

image

The control node looks like this:
image

And the smart scene looks like this