Skip to content

Instantly share code, notes, and snippets.

@nbartels
Created February 25, 2021 08:05
Show Gist options
  • Save nbartels/3fb7cf9728e8f7f5791bc8a76655500d to your computer and use it in GitHub Desktop.
Save nbartels/3fb7cf9728e8f7f5791bc8a76655500d to your computer and use it in GitHub Desktop.
Washing machine Openhab Rule example
var Number counter = 11
rule "washernotification"
when
Item MeterWasherEnergyPower received update
then
logInfo("MeterWasherEnergyPower", "received update " + MeterWasherEnergyPower.state)
if (MeterWasherEnergyPower.state > 3.0) {
counter = 0
} else {
if (counter < 12) {
counter = counter + 1
}
if (counter == 10) {
// Send email, telegram whatever here
}
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment