This object is in archive! 
http switch as sensor
Need Answer
Just a short question: If I use a virtual switch from the control secton as a Sensor, I have six options (see picture). If I use the same switch from the actuator section, I only have three options. Could someone please explain those choices for virtual sensors? (In a meter block they both only have the same options: on or off respectivly)
Best regards
Klaus
No connection
Real-time notifications may not work
Klaus,
I don't know really why we have these differences, for this case I think it is the same. This resemble object oriented programing languages. Attribute refers to a property of the object, in this case the Switch can be ON/OFF, but for some reason can be ANY (which refers more to an event). Event should be something that happens with this device, it can be switched ON, OFF or also it has an event active when it changes state (any), these events happen one time, so the event should is like a trigger, whereas the attribute will stay ON until the device change it's attribute. I hope I'm clear, I always use attribute when I need to evaluate the status of the switch.
I could probably test this with some rules to prove my teory, unfortunatelly I'm having sync issues and cannot test right now.
Klaus,
I don't know really why we have these differences, for this case I think it is the same. This resemble object oriented programing languages. Attribute refers to a property of the object, in this case the Switch can be ON/OFF, but for some reason can be ANY (which refers more to an event). Event should be something that happens with this device, it can be switched ON, OFF or also it has an event active when it changes state (any), these events happen one time, so the event should is like a trigger, whereas the attribute will stay ON until the device change it's attribute. I hope I'm clear, I always use attribute when I need to evaluate the status of the switch.
I could probably test this with some rules to prove my teory, unfortunatelly I'm having sync issues and cannot test right now.
I dont have the option of 6 states for a virtual switch, only 3 same as virtual sensor.
In a meter block there are only 2 options, on/off. Not sure whats going on.
But the main reason for using a virtual sensor as opposed to a virtual switch, is you have a url available for a sensor making it easier to use outside of the zipato system.
But as Alberto says, the 3 options, on/off/any, are triggers for a rule. If you want a rule(or program if you rather) to run dependant on a specific switch state, or any time it is changed.
I dont have the option of 6 states for a virtual switch, only 3 same as virtual sensor.
In a meter block there are only 2 options, on/off. Not sure whats going on.
But the main reason for using a virtual sensor as opposed to a virtual switch, is you have a url available for a sensor making it easier to use outside of the zipato system.
But as Alberto says, the 3 options, on/off/any, are triggers for a rule. If you want a rule(or program if you rather) to run dependant on a specific switch state, or any time it is changed.
Hello,
I use "any" (as sensor) to trigger rules, eg. when a switch changes from on to off or vice versa (toggle / edge triggered).
This works fine and you don't need to bother about a switch state.
What I'm also not entirely shure about, is the difference between selecting a switch from my devices from Actuators or Control. In the beginning I've taken switches from Control (and choose attribute) as that sounded more logical to me. However it did not always properly work (could also have been some other general stability issues i faced at that time).
Nowdays I take the switches from Actuators and it works fine.
Maybe it does not matther, but maybe Zipato can enlight us if there is a better choise (Actuators or Control)?
BR Raffael
Hello,
I use "any" (as sensor) to trigger rules, eg. when a switch changes from on to off or vice versa (toggle / edge triggered).
This works fine and you don't need to bother about a switch state.
What I'm also not entirely shure about, is the difference between selecting a switch from my devices from Actuators or Control. In the beginning I've taken switches from Control (and choose attribute) as that sounded more logical to me. However it did not always properly work (could also have been some other general stability issues i faced at that time).
Nowdays I take the switches from Actuators and it works fine.
Maybe it does not matther, but maybe Zipato can enlight us if there is a better choise (Actuators or Control)?
BR Raffael
Replies have been locked on this page!