Can you create a custom 'switch'?

Moderator: leecollings

Post Reply
Timmiej93
Posts: 64
Joined: Saturday 26 December 2015 0:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Can you create a custom 'switch'?

Post by Timmiej93 »

I'm looking to create a custom switch for Domoticz. A completely new GUI and functionality. I'm guessing this should be possible, I just haven't been able to find anything related to the switches in the GUI at all. If this is even possible, it would be great if somebody could point me in the direction of the files that create the switches in Domoticz, so I can try and figure out how to create my own version.
BartSr
Posts: 395
Joined: Sunday 03 July 2016 16:16
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.7
Location: Netherlands
Contact:

Re: Can you create a custom 'switch'?

Post by BartSr »

What is your goal?
Kr
Bart
Raspberry pi 3b
Arduino
KAKU
RfxCom
Zwave2MQTT
OTGW
Chinese sensors temp (Dallas),movement
Tasmota
Esp8266 / 32 espeasy
Zigbee2MQTT
Timmiej93
Posts: 64
Joined: Saturday 26 December 2015 0:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Can you create a custom 'switch'?

Post by Timmiej93 »

That's a good question. I think my goal was to have a slider that sets a countdown timer, which then slowly slides back to zero. I know this could be accomplished with some code and a normale dimmer switch, but I'd prefer to have the time in the top right corner, instead of a percentage, and stuff like that.
Tiempie
Posts: 2
Joined: Wednesday 11 March 2020 12:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Can you create a custom 'switch'?

Post by Tiempie »

Yes you can, I created a switch to execute a shell script for on and off to control my PS4.
Schermafbeelding 2020-03-11 om 12.17.30.png
Schermafbeelding 2020-03-11 om 12.17.30.png (372.19 KiB) Viewed 1470 times
TheExpert
Posts: 3
Joined: Saturday 06 June 2020 17:24
Target OS: Windows
Domoticz version: 2020.2
Contact:

Re: Can you create a custom 'switch'?

Post by TheExpert »

Hello all,

I'm new to Domoticz, coming from openHAB and it was easy to get things running - after all prerequisites are fullfilled, i. e. Python for the HomeWizard plugin. It's cool to get the status of all HomeWizard items without programming the requests for this! I'm using Domoticz build 2020.2 on a Windows 10 2004 machine.

Now, I want to add custom switches for executing OS commands to switch a USB power strip with 4 sockets on or off. With HA Bridge this was very easy. I'm using it for controling smart home items by Amazon Alexa. But I don't know how to this with Domoticz. I can only add new switches when selecting a hardware item. But I don't have one to select. What do I have to do now?

UPDATE: I found a solution. You first have to add a hardware of type "Dummy (Does nothing, use for virtual switches only)". Then you can add virtual devices which are added to switch tab automatically. There you can edit the switches as shown in the post of @Tiempie. But I wasn't able to define one batch script and set it up with command line parameters in the virtual devices because of the spaces in the command. I solved this by creating 8 scripts (ON and OFF for 4 power sockets). It's not the best way but it works ;-). I'm not comfortable with LUA or dzVents yet. Maybe there's a better possibility to get this working.

Thank you very much for helping me.
Kind Regards.
clemberto
Posts: 2
Joined: Wednesday 24 June 2020 19:59
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Can you create a custom 'switch'?

Post by clemberto »

Hi. I am also new to Domoticz, how come there is such little info/access to UI cutomization?
I think the web interface is looking really good, it is a shame we cannot adapt to specific need.
As for example, the Venetian Blind button have no 'Stop' action configuration although the button is here!
Can anyone reply to original question which is :
Timmiej93 wrote: Sunday 08 July 2018 21:39 if somebody could point me in the direction of the files that create the switches in Domoticz, so I can try and figure out how to create my own version.
Thanks,
clement.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest