I'm slightly confused about events.
I have a lightwave rfremote with 3 sets of 0/1 buttons
These are setup as on/off switched LWRem1,LWRem2, LWRem3 in domoticz
In events using blocky I can create an event that says if (LWRem1) do xxx but what I want to say is if LWRem1=On then or similar, ie I want to distinguish between the off and on button.
For now I defined scenees to do similar effect, but events may prove more flexible.... especially to consolidate multiple devices, link with weather/time of day.
For reference so far I also have some LWRF sockets defined as switches -- control from the UI is fine, and also have imported light/group/scene definitions from Philips Hue, which all appear as a myriad of switches
Blocky if switch=on ?
Moderator: leecollings
-
- Posts: 234
- Joined: Thursday 09 July 2015 12:03
- Target OS: Linux
- Domoticz version: 2.4538
- Location: Norway
- Contact:
Re: Blocky if switch=on ?
do not quite understand what you mean.
Could you come with an example of what you want to achieve?
Could you come with an example of what you want to achieve?
-
- Posts: 32
- Joined: Friday 29 January 2016 15:27
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blocky if switch=on ?
Sure,
I have a raspberry pi using domoticz (beta channel). 2.4692 is the current version
To the pi is connected a RFXtrx433e device running firmware 251
I have a set of 3 lightwaveRF "basic" sockets, and the supplied 3 channel remote
I also have a philips hue hub with a variety of groups/lights/scenes imported
the rfx device is setup in domoticz to support all protocols (as I experiment, aware of some limitations)
Under "switches" I have
LWRem1
LWRem2
LWRem3
These represent the three lines (0/1) of the lightwave remote
If I click the "1" button of the first row, the dashboard will show LWRem1 moving to "On" state. Similarly if I click "0" it will move to the off state
I defined a scene "work" where the activiation device is listed as
LWRem1 On
and the Device is
Group Study 100% (this is a hue light bulb group)
I created another scene "All off" where activation is
LWRem1 Off
and the device is the same
This means I can switch the light on/off.
It's overkill compared to a simple switch, but the idea in future is to bring in more complex configurations using other devices.
However I also looked at the "events" capability which to me seemed more flexible .. and as a programmer, a little more intuitive.
ie if someone presses LWRem0=on I'd like to turn light on, If someone presses LWRem0=off I'd like to turn it off
So in events I went to "control" in blocky and selected a "If-Do" puzzle piece.
Then from devices/switches I picked G-L "LWRem1", and I can slot this into the predicate section of the if-do piece.
But then it just says If (LWRem1) then...
I only want to process the event if the On button is pressed, not the off. I can't see how to do this?
Rather than have the remote "LWRem1"'s too buttons set as an On/Off switch, do I need to set them up independently so that each appears as an independent device?
I have a raspberry pi using domoticz (beta channel). 2.4692 is the current version
To the pi is connected a RFXtrx433e device running firmware 251
I have a set of 3 lightwaveRF "basic" sockets, and the supplied 3 channel remote
I also have a philips hue hub with a variety of groups/lights/scenes imported
the rfx device is setup in domoticz to support all protocols (as I experiment, aware of some limitations)
Under "switches" I have
LWRem1
LWRem2
LWRem3
These represent the three lines (0/1) of the lightwave remote
If I click the "1" button of the first row, the dashboard will show LWRem1 moving to "On" state. Similarly if I click "0" it will move to the off state
I defined a scene "work" where the activiation device is listed as
LWRem1 On
and the Device is
Group Study 100% (this is a hue light bulb group)
I created another scene "All off" where activation is
LWRem1 Off
and the device is the same
This means I can switch the light on/off.
It's overkill compared to a simple switch, but the idea in future is to bring in more complex configurations using other devices.
However I also looked at the "events" capability which to me seemed more flexible .. and as a programmer, a little more intuitive.
ie if someone presses LWRem0=on I'd like to turn light on, If someone presses LWRem0=off I'd like to turn it off
So in events I went to "control" in blocky and selected a "If-Do" puzzle piece.
Then from devices/switches I picked G-L "LWRem1", and I can slot this into the predicate section of the if-do piece.
But then it just says If (LWRem1) then...
I only want to process the event if the On button is pressed, not the off. I can't see how to do this?
Rather than have the remote "LWRem1"'s too buttons set as an On/Off switch, do I need to set them up independently so that each appears as an independent device?
- StanHD
- Posts: 347
- Joined: Friday 12 July 2013 16:09
- Target OS: Windows
- Domoticz version:
- Location: East Sussex, UK
- Contact:
Re: Blocky if switch=on ?
Hi, do you mean something like this?
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
-
- Posts: 32
- Joined: Friday 29 January 2016 15:27
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blocky if switch=on ?
yes, that's what I was expecting .. and now that you've shared that I see how to do in the UI. I hadn't noticed that equality (or other) check in logic!
I'll try again later...... thanks!
In general though if a switch has off/on position is it best modeled as a single on/off switch or as two buttons? I assume the answer is it-depends ... ! If I use as on/off in general the former probably makes sense, whilst if I want to use it more like a scene control with 6 settings (the remote is 3 on/off) modeling each individually may be more intuitive
I'll try again later...... thanks!
In general though if a switch has off/on position is it best modeled as a single on/off switch or as two buttons? I assume the answer is it-depends ... ! If I use as on/off in general the former probably makes sense, whilst if I want to use it more like a scene control with 6 settings (the remote is 3 on/off) modeling each individually may be more intuitive
Who is online
Users browsing this forum: No registered users and 0 guests