How to create toggle action in UI7?

Hi,
I have a few scenes from my old UI that have toggle actions for lights, but I cannot seem to find this for UI7. Any tips on how to proceed?

Cheers,

Lars

You could always use a little Lua code. The following code will toggle a Z-Wave switch. Set the required device number instead of 123. Paste the code into the scene’s Luup Code tab.

local dID = 123 -- Device ID of your Z-Wave Switch local status = luup.variable_get("urn:upnp-org:serviceId:SwitchPower1","Status",dID) if status == "1" then luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{newTargetValue=0},dID) else luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{newTargetValue=1},dID) end

Thanks, but I was kind of hoping to be able to do it easily like in the old version of the firmware…but…I need to start playing with LUA anyway, so. Thanks :slight_smile:

If anyone knows how to do it the old fashion way I’d love to hear it, though :smiley:

Toggle is actually there as an advanced scene action, but very hard to find. I have one scene which toggles a light (use it with a remote to get a single button on/off control) but it was a struggle to make, and alas, I can’t recall off-hand. But it IS possible. I will try and retrace my path to creating it, however, from editing the scene, I see:

[ul][li]it is a CUSTOM action[/li]
[li]the Advanced Editor gives me access to an “Add action” button under “Delay: Immediate”[/li]
[li]ToggleState is a selectable option from a list of actions[/li][/ul]

Not sure if any of the above words will help you get closer to the actual sequence of events.

[quote=“akbooer, post:4, topic:186113”]Toggle is actually there as an advanced scene action, but very hard to find. I have one scene which toggles a light (use it with a remote to get a single button on/off control) but it was a struggle to make, and alas, I can’t recall off-hand. But it IS possible. I will try and retrace my path to creating it, however, from editing the scene, I see:

[ul][li]it is a CUSTOM action[/li]
[li]the Advanced Editor gives me access to an “Add action” button under “Delay: Immediate”[/li]
[li]ToggleState is a selectable option from a list of actions[/li][/ul]

Not sure if any of the above words will help you get closer to the actual sequence of events.[/quote]
Thanks, I actually saw your reply when I came back to say I’d found it - but might be good for other people if they search for toggle :slight_smile: