I am looking for suggestions on how to implement LHS of a rule so the RHS would be triggered only when the value of the sensor in the LHS changes from zero to something else. Application is plug-in power monitor and I want to trigger RHS only when the wattage changes from zero to anything I.e when the appliance plugged in to it turns on.
Currently I am using source == "sensor", value > 0
This triggers the RHS every time wattage changes ( appliance plugged in to it is a washing machine and value keeps wattage changes very frequently during the wash cycle)
Thanks
Have you considered using a chain of rules?
Your energy counter state could toggle the state of an in-memory switch.
Then have a rule monitor the in-memory switch state to achieve what you're looking for?
For example :- (syntax is very wrong)
// This will trigger repeatedly
source == "energy_sensor", value > 0
Then
Executecommand ("in-memory_on"):
// This will only trigger on a state change to on.
source == "in-memory state", =="on"
Then
ExecuteCommand ("whatever you want done once"):
// Toggle in-memory state to off
source == "energy_sensor", value == 0
Then
ExecuteCommand ("in-memory_off"):