# Virtual switch

**URL:** <https://forum.ewelink.cc/t/virtual-switch/22879>\
**Category:** Ideas & Suggestion\
**Created:** [October 13, 2023, 11:51pm UTC](https://forum.ewelink.cc/t/virtual-switch/22879 "2023-10-13T23:51:36Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ramadap](https://avatars.discourse-cdn.com/v4/letter/r/eb8c5e/32.png) [@ramadap](https://forum.ewelink.cc/u/ramadap)\
**Post date:** [October 13, 2023, 11:51pm UTC](https://forum.ewelink.cc/t/virtual-switch/22879/1 "2023-10-13T23:51:36Z")

</div>

Is it possible to define a virtual switch (flag, boolean, call it whatever) in ewelink? This would be super useful.

A device supported by assistant platforms, such as Amazon and Google, could then be integrated into the ewelink ecosystem easily. For instance, I have a video intrusion system and a door lock that is supported by Alexa, but not by ewelink. Setting a switch from Alexa on set events from these devices, would allow me to run ewelink scenes.

Right now, I’m using s physical 4 unit relay for this, but it is a clunky solution.

---

<div class="post-metadata">

**Author:** ![y.shvager2021](https://avatars.discourse-cdn.com/v4/letter/y/b5e925/32.png) [@y.shvager2021](https://forum.ewelink.cc/u/y.shvager2021)\
**Post date:** [October 16, 2023, 1:15pm UTC](https://forum.ewelink.cc/t/virtual-switch/22879/2 "2023-10-16T13:15:35Z")

</div>

If you want Alexa to run Eweink scense, just define the sense as a tap to run and you can select to operate it from alexa.

---

<div class="post-metadata">

**Author:** ![valter.isander](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/valter.isander/32/2975_2.png) [@valter.isander](https://forum.ewelink.cc/u/valter.isander)\
**Post date:** [October 17, 2023, 7:07am UTC](https://forum.ewelink.cc/t/virtual-switch/22879/3 "2023-10-17T07:07:31Z")

</div>

Agree totally.

---

<div class="post-metadata">

**Author:** ![ramadap](https://avatars.discourse-cdn.com/v4/letter/r/eb8c5e/32.png) [@ramadap](https://forum.ewelink.cc/u/ramadap)\
**Post date:** [October 18, 2023, 12:19am UTC](https://forum.ewelink.cc/t/virtual-switch/22879/4 "2023-10-18T00:19:48Z")

</div>

Yes, I know that. But that only covers that scenario. Lots of devices cannot trigger routines on Amazon, and it is not possible to trigger auto scenes in ewelink from devices that it does not support. All that could be done if only ewelink supported virtual switches.

---

<div class="post-metadata">

**Author:** ![eerke](https://avatars.discourse-cdn.com/v4/letter/e/eb9ed0/32.png) [@eerke](https://forum.ewelink.cc/u/eerke)\
**Post date:** [October 18, 2023, 2:06am UTC](https://forum.ewelink.cc/t/virtual-switch/22879/5 "2023-10-18T02:06:54Z")

</div>

Do you have one of the devices that support NodeRED? I think it is the iHost and the NS Panel Pro.

---

<div class="post-metadata">

**Author:** ![andre1](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@andre1](https://forum.ewelink.cc/u/andre1)\
**Post date:** [October 19, 2023, 1:31pm UTC](https://forum.ewelink.cc/t/virtual-switch/22879/6 "2023-10-19T13:31:26Z")

</div>

I had felt exactly the same need to be able to define some more complex scenes. Also in my case I ended up having to use some “sonoff micro” to overcome the problem.  
Being able to define a virtual switch would indeed be a fantastic feature.

---

<div class="post-metadata">

**Author:** ![eerke](https://avatars.discourse-cdn.com/v4/letter/e/eb9ed0/32.png) [@eerke](https://forum.ewelink.cc/u/eerke)\
**Post date:** [October 20, 2023, 2:02am UTC](https://forum.ewelink.cc/t/virtual-switch/22879/7 "2023-10-20T02:02:04Z")

</div>

You use to able to set Booleans in [Apilio.IO](http://Apilio.IO) when it was free, which would connect to IFTTT and then eWeLink (both also were free). Now to do complex stuff in the cloud you need eWeLink premium, Ifttt and Apilio subscriptions.  
If people use devices they make money: I think they should allow more complexity for subscribers to eWeLink Advanced to encourage subscriptions to the plan.

---

<div class="post-metadata">

**Author:** ![DJackCZ](https://avatars.discourse-cdn.com/v4/letter/d/a5b964/32.png) [@DJackCZ](https://forum.ewelink.cc/u/DJackCZ)\
**Post date:** [November 2, 2023, 10:35pm UTC](https://forum.ewelink.cc/t/virtual-switch/22879/9 "2023-11-02T22:35:56Z")

</div>

I agree 100%. I also use unnecessary physical devices to then test in the scene whether it should be done. If it was just virtual and could be named and used in scenes, that would be great. And it’s not just ON/OFF states, but I would use it, for example, for The maximum temperature is set to 22.5°C. But we probably want that too much and the manufacturers would lose sales of the device.

---

<div class="post-metadata">

**Author:** ![valter.isander](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/valter.isander/32/2975_2.png) [@valter.isander](https://forum.ewelink.cc/u/valter.isander)\
**Post date:** [November 7, 2023, 3:38pm UTC](https://forum.ewelink.cc/t/virtual-switch/22879/10 "2023-11-07T15:38:10Z")

</div>

Idea:  
Would it be possible to “timeshare” a unit.  
If time X to y then set  
If not and it’s set, then it’s another triggering action.

But it’s just an idea.

“If there is a girl at the corner and it’s afternoon, it’s Alice, else it’s Angelica” … 😀

---

<div class="post-metadata">

**Author:** ![ramadap](https://avatars.discourse-cdn.com/v4/letter/r/eb8c5e/32.png) [@ramadap](https://forum.ewelink.cc/u/ramadap)\
**Post date:** [November 21, 2023, 10:30pm UTC](https://forum.ewelink.cc/t/virtual-switch/22879/11 "2023-11-21T22:30:30Z")

</div>

You could use the schedule option on a physical relay, and then test it’s state.

---

<div class="post-metadata">

**Author:** ![ramadap](https://avatars.discourse-cdn.com/v4/letter/r/eb8c5e/32.png) [@ramadap](https://forum.ewelink.cc/u/ramadap)\
**Post date:** [November 21, 2023, 10:36pm UTC](https://forum.ewelink.cc/t/virtual-switch/22879/12 "2023-11-21T22:36:32Z")

</div>

You could use a sensor with an in built switch, and use its state to trigger some action.

These solutions are clumsy but they should work.

---

<div class="post-metadata">

**Author:** ![valter.isander](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/valter.isander/32/2975_2.png) [@valter.isander](https://forum.ewelink.cc/u/valter.isander)\
**Post date:** [November 22, 2023, 7:55am UTC](https://forum.ewelink.cc/t/virtual-switch/22879/13 "2023-11-22T07:55:49Z")

</div>

Yes, that’s a possibility.  
Let’s say - I have 5 PIRs in 5 houses, want to examine which PIR was hit.  
PIR 1 works during 00-05 min  
PIR 2 during 05-10 min  
Etc  
Then I can see which PIR was active, by looking at time.

Drawback: clumsy. And every PIR will not always react if motion doesn’t occur for time longer than 20 minutes.

I need a webhook and a computer, a program looping very fast (0,1 seconds) to be sure every PIR has seen what I want to be seen.

A better solution would be cells in the server memory, an I can read cells (bit 0/1). That’s a need for not only me. IFTTT has that feature, it can sense a PIR and the reaction is relatively fast.  
Valter  
Stockholm

---

<div class="post-metadata">

**Author:** ![mario.bianchi](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@mario.bianchi](https://forum.ewelink.cc/u/mario.bianchi)\
**Post date:** [April 29, 2024, 9:08pm UTC](https://forum.ewelink.cc/t/virtual-switch/22879/14 "2024-04-29T21:08:16Z")

</div>

Know this thread is old… just wanted to mention you can create virtual switches in SmartThings and expose them into eWeLink. That is the way that I ocassionally create them.

---

<div class="post-metadata">

**Author:** ![ramadap](https://avatars.discourse-cdn.com/v4/letter/r/eb8c5e/32.png) [@ramadap](https://forum.ewelink.cc/u/ramadap)\
**Post date:** [May 1, 2024, 11:39pm UTC](https://forum.ewelink.cc/t/virtual-switch/22879/15 "2024-05-01T23:39:28Z")

</div>

How do you expose smarthing devices to ewelink?

---

<div class="post-metadata">

**Author:** ![john.e.dixon](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/john.e.dixon/32/1626_2.png) [@john.e.dixon](https://forum.ewelink.cc/u/john.e.dixon)\
**Post date:** [May 2, 2024, 5:52am UTC](https://forum.ewelink.cc/t/virtual-switch/22879/16 "2024-05-02T05:52:50Z")

</div>

An iHost allows creating a virtual switch in node-red, as shown in @csongor.varga 's YouTube video.  
This then comes across in a Matter bridge to Smartthings. The only problem is, for me at least, it seems to cause the Matter bridge to crash out. Has anyone got this to work?

---

<div class="post-metadata">

**Author:** ![jam3](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/jam3/32/7918_2.png) [@jam3](https://forum.ewelink.cc/u/jam3)\
**Post date:** [May 2, 2024, 6:10am UTC](https://forum.ewelink.cc/t/virtual-switch/22879/17 "2024-05-02T06:10:18Z")

</div>

A remarkably simple combination 🙂

---

<div class="post-metadata">

**Author:** ![tl.box.212](https://avatars.discourse-cdn.com/v4/letter/t/4491bb/32.png) [@tl.box.212](https://forum.ewelink.cc/u/tl.box.212)\
**Post date:** [May 8, 2024, 11:53pm UTC](https://forum.ewelink.cc/t/virtual-switch/22879/18 "2024-05-08T23:53:09Z")

</div>

Hi  
Yes, a virtual switch would be really useful. I am sure I have seen a video on generating a switch in node-red, but it was a couple of years old. However it did not work for me – the only devices that would work were/are temperature & humidity sensors and temperature sensors. The other issue is that the capabilities offered for a device do not change – I am fairly positive that ‘brightness’ and ‘colour’ are not much use to a switch?  
While looking for answers I came across another video by Csongor which seems to agree there are only two working sensors.  
Does this mean that virtual devices are being got rid of?

---

<div class="post-metadata">

**Author:** ![john.e.dixon](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/john.e.dixon/32/1626_2.png) [@john.e.dixon](https://forum.ewelink.cc/u/john.e.dixon)\
**Post date:** [May 9, 2024, 5:39am UTC](https://forum.ewelink.cc/t/virtual-switch/22879/19 "2024-05-09T05:39:35Z")

</div>

> [@tl.box.212](#):
>
> the only devices that would work were/are temperature & humidity sensors and temperature sensors.

Have you got these working and then tried bridging by Matter to another platform?  
I tried those that @csongor.varga shows but then it crashes my Matter bridge.  
Can’t seem to identify if this is a problem of incompatible capabilities in Matter or simply that virtual switches are not really intended by Sonoff to be a usable feature.

---

<div class="post-metadata">

**Author:** ![ward](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/ward/32/10437_2.png) [@ward](https://forum.ewelink.cc/u/ward)\
**Post date:** [May 9, 2024, 6:09am UTC](https://forum.ewelink.cc/t/virtual-switch/22879/20 "2024-05-09T06:09:29Z")

</div>

> [@john.e.dixon](#):
>
> Matter bridge to crash

A misconfigured virtual device could cause such a crash, could you please provide us with the information of the node?

Thx in advance

---

<div class="post-metadata">

**Author:** ![john.e.dixon](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.ewelink.cc/john.e.dixon/32/1626_2.png) [@john.e.dixon](https://forum.ewelink.cc/u/john.e.dixon)\
**Post date:** [May 9, 2024, 6:25am UTC](https://forum.ewelink.cc/t/virtual-switch/22879/21 "2024-05-09T06:25:24Z")

</div>

Thanks for your quick reply! I had deleted them for the moment as I needed to have my Matter bridge running. This weekend I’ll recreate them and send to you by DM.  
👍

[Next page](https://forum.ewelink.cc/t/virtual-switch/22879.md?page=2)
