Hey all,
First post as I’m migrating from OpenHAB to HA + NodeRed. Loving it so far but stuck on getting an automation I had running on OpenHAB doing the same in NodeRed.
I use a Sonoff POW R2 to monitor our washing machine power usage to alert when it has finished its cycle. My OpenHAB rule went like this…
// Washing Machine States
val Number MODE_OFF = 0
val Number MODE_STANDBY = 1
val Number MODE_ACTIVE = 2
val Number MODE_FINISHED = 3
rule "Washing Machine Consumption State"
when
Item WashingMachine_Power changed
then
if (WashingMachine_Power.state < 0.7) {
WashingMachine_OpState.postUpdate(MODE_OFF)
}
else if (WashingMachine_Power.state > 10) {
WashingMachine_OpState.postUpdate(MODE_ACTIVE)
}
else if (WashingMachine_Power.state < 2.5) {
if (WashingMachine_OpState.state == MODE_OFF) {
WashingMachine_OpState.postUpdate(MODE_STANDBY)
}
else if (WashingMachine_OpState.state == MODE_ACTIVE) {
WashingMachine_OpState.postUpdate(MODE_FINISHED)
}
}
end
So basically when the power shifted from being ACTIVE to FINISHED I would get an alert.
Can anyone suggest a way of monitoring my “sensor.washingmachine_energy_power” so that when it moves from > 10 to < 10 for a period of time I can then send a telegram alert?
Trying the following but I suspect that because the power usage “bounces” it needs to be monitored over a couple of minutes…
[{"id":"77463abea3de96cf","type":"trigger-state","z":"df447a6efee3d089","name":"Moves from Running To Standby","server":"ae820eaf.1b0e8","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"sensor.washingmachine_energy_power","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"current_state","comparatorType":"<","comparatorValueDatatype":"str","comparatorValue":"10","propertyValue":"new_state.state"},{"targetType":"this_entity","targetValue":"","propertyType":"previous_state","comparatorType":">","comparatorValueDatatype":"str","comparatorValue":"10","propertyValue":"old_state.state"}],"inputs":0,"outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","enableInput":false,"x":250,"y":280,"wires":[["048ab50663283aff"],[]]},{"id":"ae820eaf.1b0e8","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]
Any assistance greatly appreciated…
Cheers, Tim