Blocky add show hide switch

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.

Moderators: leecollings, remb0

Post Reply
devros
Posts: 183
Joined: Saturday 29 October 2016 20:55
Target OS: -
Domoticz version:
Contact:

Blocky add show hide switch

Post by devros »

hello,
It would be very nice to add roomplan support to blocky, or way to show hide switches (maybe only add hidden/visible operator).
I have few switches that are usefull only in some condition and this would be great way to make stuff clean.
cjb75

Re: Blocky add show hide switch

Post by cjb75 »

I have the same question (I think), can I hide/show switches depending on their status (e.g. on -> show)? I know that if I add $ to the beginning of the switch name is will become hidden but how can I do that from a script?

For me it's find using lua (preferably dzVents).
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Blocky add show hide switch

Post by Egregius »

Use the developer console of a good browser to find the url.
You can change the name with a url like this (from Switches tab):

Code: Select all

http://192.168.2.10:8084/json.htm?type=setused&idx=5&name=NAMEOFSWITCH&description=&strparam1=&strparam2=&protected=false&switchtype=0&customimage=5&used=true&addjvalue=0&addjvalue2=0&options=
From the device table the url is even cleaner:

Code: Select all

http://192.168.2.10:8084/json.htm?type=command&param=renamedevice&idx=5&name=NAMEOFSWITCH
Attention: renaming a device requires that your scripts work with both NAMEOFSWITCH and $NAMEOFSWITCH
Could be a difficult way to go...
cjb75

Re: Blocky add show hide switch

Post by cjb75 »

Great - thanks!

In my script (dzVents) I'm using the ID to identify the switch and hopefully avoid problems with different names...

Code: Select all

return {
..
        on = {
                --'Test_Switch',
                --'$Test_Switch',
                3
        },
        execute = function(domoticz,switch)
..
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest