Hello
New to HA, I have running openhab for some years but not but dont like openhab2 so i want to try HA.
In openhab you can write a rule that trigger when a state get an update but NOT changed
Is this pobilble in HA ?
I have try many diffrent setting but can not trigger it.
I wnat this because i have some sensor that only sends ‘off’ when it triggerd.
I have an simple test automation that work when i send on then off …
- alias: update test
trigger:
- platform: state
entity_id: binary_sensor.sensor_2
from: 'off'
# to: 'on'
action:
service: persistent_notification.create
data:
message: "Test"
A workaround could be to set it back to ‘on’ when triggerd but i want yo check with you first.
I can also use the mqtt trigger but some sensors dont use mqtt.
In case leaving away the from/to does not solve the problem:
A sensor-device that only pushes update-messages without a real state are more comparable to events in HASS. At least as I understand it, the sensors you are using are never onoroff, but instead always send off as soon as the sensor does it’s thing. So it has no state that you can query.
If I’m getting that correctly, my personal opinion would be to somehow make the device trigger events in HASS.
This could be done via the RESTful API. If for example you would keep openhab running and have an automation there that fires you custom event via REST, you could then use the Event trigger in HASS to react on that.
Looking at your example the sensors use MQTT. If they could do POST-requests instead without openhab in the middle, it would be even easier.