Page 1 of 1

Virtual on-off switch not found in blockly devices/switches

Posted: Sunday 03 March 2019 11:59
by gschmidt
Hi,

running Domoticz beta version Version 4.10532 on an Rpi3b+

I want to create a blockly script for a virtual switch (lighting 1, X10 On/Off) I have created in domoticz, but it is not listed in blockly devices/switches.
This is strange because I have several of these virtual switches which are all listed in blockly devices/switches.

Somebody any idea why it is not listed?

Re: Virtual on-off switch not found in blockly devices/switches

Posted: Sunday 03 March 2019 12:17
by Ricard1
I had the same issue and if I remember right I switched to another browser or cleared browser cache, or maybe restarted Domoticz... :)

Re: Virtual on-off switch not found in blockly devices/switches

Posted: Sunday 03 March 2019 12:22
by gschmidt
Ricard1 wrote: Sunday 03 March 2019 12:17 I had the same issue and if I remember right I switched to another browser or cleared browser cache, or maybe restarted Domoticz... :)
Clearing the browser cache did the trick! thx

Re: Virtual on-off switch not found in blockly devices/switches

Posted: Wednesday 21 October 2020 18:36
by ESFnl
One more thumbs up for Richard1! It was an old question and solution but helped me a lot!

Re: Virtual on-off switch not found in blockly devices/switches

Posted: Tuesday 04 January 2022 22:09
by lazaruss72
with some browsers it is also sufficient to press the Shift key and F5 (reload). Then the switches are displayed.

Re: Virtual on-off switch not found in blockly devices/switches

Posted: Saturday 22 January 2022 18:55
by Dave21w
I had this issue too and found that going into the settings page and clicking Apply Settings even though you've changed nothing also made newly created devices appear.

Re: Virtual on-off switch not found in blockly devices/switches

Posted: Wednesday 26 April 2023 19:15
by DaaNMaGeDDoN
Hey folks, i ran into the same issue, but things might be a bit different and possibly this is a bug:

Steps: went into Setup->Hardware and created a Dummy switch, gave it a name, pressed OK and the notification tells me it has been created.
(nb it says i should be looking for it in the devices, not switches) <-probably legacy code
At that moment the switch shows up in the Devices list (used, for some reason, maybe that's new) and like expected with a "used" switch it shows up at the bottom of the "Switches" page.
I went there, clicked Edit on the new switch and set the following:
Switch Type: Selector
Selector Style: Button set
gave it three level names: Off, Low, High and kept the default level values.
Pressed Save.

After that, whichever browser or device i use it doesn't show up at the bottom of the Switches page any longer.
Curious thing is i can still see it in Setup->Devices and if i exploit the "edit-url" like "https://mydomain.tld:9191/#/Devices/IDX/LightEdit", i can still edit it. Also the device DOES show up in the app on my phone in the switches section. There, if i set it as a favorite, it DOES show up in the browsers on the Dashboard, but still nothing in the Switches page.

None of the mentioned tricks work;

- restarting domoticz
- clearing browser caches
- trying different browsers
- changed the theme to default

As i was writing these steps down i figured the "trick" of making it a favorite via the app might work around this(and it did partially), so there is no immediate need to resolve this at this moment because i can work with that for now.
Going further, i noticed in the app on my phone it mentioned something (to late now to remember now) like it's state was undefined. Once (via the dashboard) i set the selector switch to "Off" it DOES appear in the switches page!

TLDR: i think the switches page does not show any (newly) created selector switches for which no initial state is defined. This might be a bug in the code that modifies the switch from a normal on/off into a selector switch. I guess that helps the devs ;-)

So actually i was able to resolve this myself, but who knows somebody else might run into this issue, the obvious trick is to set it as a fav in the app on your phone, select a state through the dashboard and your switch now appears like expected. I verified that you can remove it as a favorite after that and things behave as expected.

Re: Virtual on-off switch not found in blockly devices/switches

Posted: Monday 21 October 2024 17:38
by saarwh
A small addition to the solution of clearing the browser cache with ctrl+F5; there was an update pending for Firefox due to which the cache couldn't be cleared. After updating Firefox the switch was visible!