FHEM Forum

FHEM => Automatisierung => Thema gestartet von: xypzo am 10 Januar 2020, 12:51:15

Titel: Trigger push message if mqqt2 value reaches 0
Beitrag von: xypzo am 10 Januar 2020, 12:51:15
Hi
I am looking for a way to get a push bullet message when my washing machine power meter is reaching 0 watts.
To get a message at a specific value is easy, but i want a message only when the power DROPS from > 1 to 0

Otherwise i will get a push message all the time as the power is normally 0 watts when not washing.

So i was checking out AT / IF / DOIF / NOTIFY / DEFMOD possibilities but can't find any way to only trigger when dropping down.

Any advice? Maybe event_on_reading ?
I am not a programmer nor a fanatic, so i probably need some kindergarden-type advice haha

Titel: Antw:Trigger push message if mqqt2 value reaches 0
Beitrag von: Beta-User am 10 Januar 2020, 13:09:25
As always: There's quite a few ways to go.

One of them is the mentionned "event-on-change"-option. As long as the value will stay at "0", e.g. "notify" will only be triggered once, so it's easy to use the "is easy" code you claim to already have (no real experience w. "DOIF", might be different there).

Other way: Use the oldReadings-feature and do a comparison if that was >0.

Good success!

Titel: Antw:Trigger push message if mqqt2 value reaches 0
Beitrag von: xypzo am 10 Januar 2020, 13:29:37
I just found a very easy way!
THRESHOLD does the trick:
define WasKlaar Wasmachine_Power:ENERGY_Power:1:5 Push | set Push message De wasmachine is klaar |

Washing machine uses 4 watt after the program is finished, this triggers the push message when it falls down 1 from value 5

Thnx