Trigger push message if mqqt2 value reaches 0

Begonnen von xypzo, 10 Januar 2020, 12:51:15

Vorheriges Thema - Nächstes Thema

xypzo

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


Beta-User

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!

Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: ZigBee2mqtt, MiLight@ESP-GW, BT@OpenMQTTGw | ZWave | SIGNALduino | MapleCUN | RHASSPY
svn: u.a Weekday-&RandomTimer, Twilight,  div. attrTemplate-files, MySensors

xypzo

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