My problem arose when I tried to set up 3 key fobs, 1 for each in the house. The key fob has 3 programmable buttons, so in order to maximize it's usability, I attempted to set up 2 different functions on the same button. I wanted it so that if button 1 is pressed and the door is locked, the door will unlock, and conversely if button 1 is pressed and the door is unlocked, the door will lock.
so
if ($doorlocked=true and $keyfob1=button1)
{
then $doorlocked=false
}
and
if ($doorlocked=false and $keyfob1=button1)
{
then $doorlocked=true
}
repeated for $keyfob2 and $keyfob3
Logically this makes sense and when you press the button 1 on the key fob, it will change the state of the key lock to the opposite of what it was. The problem is that I the lock is not just a conditional, it is also a trigger, so the it looks more like this:
if (($keyfob1 changes state) or ($doorlocked changes state))
then
{
if ($doorlocked=true and $keyfob1=button1)
{
then $doorlocked=false
}
}
so when the lock changes state, all rules with the lock as a trigger are checked and run, if applicable, (not necessarily all rules. the order in which the devices are added appears to have something to do with which rules are run). With multiple Key Fobs, if the last button pressed on any of the other key fobs (assuming you're using the first key fob added) was button 1, when it gets to the rules for that key fob the conditions will be met and the rule executed thus undoing the first rule (door locks and then unlocks, or vice versa).
I'd like the ability to set conditionals that are not also triggers.
if ($keyfob1 changes state)
then
{
if ($doorlocked=true and $keyfob1=button1)
{
then $doorlocked=false
}
}
I tried to do something similar with a fan plugged into a peanut plug which is zigbee instead of z wave like the door lock (I point out because I think the speed of transfer causes this problem).
if ($keyfob1 changes state or $peanut changes state)
then
{
if ($peanut=true and $keyfob1=button1)
{
then $peanut=false
}
}
if ($keyfob1 changes state or $peanut changes state)
then
{
if ($peanut=false and $keyfob1=button1)
{
then $peanut=true
}
}
the result is the peanut rapidly turns off and on until I press a different button on the key fob. Adding a delay only slows down how rapidly the peanut turns off and on.