Hello! I have Home Assistant connected to Frigate with MQTT, I have used the Min/Max - Home Assistant integration to sum the value of all the vehicles detected by the cameras.
I have the setup an integration which checks whether this changes from 0 to any value, and sends a notification, here’s the trigger:
trigger: state
entity_id:
- sensor.veicoli_rilevati
from: "0"
Unfortunately, even though I see the value of this sensor changing in the UI, the automation does not get triggered. Can somebody help me debug this? Thanks.
Just to make sure you are understanding triggers correctly, they are events. In that case it will change when the state changes from a text 0 to something else.
The most likely issue is that the actual state is “0.0”… State triggers are very literal, to hedge you can just add this value to what you already have:
trigger: state
entity_id:
- sensor.veicoli_rilevati
from:
- "0"
- "0.0"
@gjohansson sorry for pinging you, but I see you are the maintainer of that integration. Could you help me understand the best way to achieve this? Thanks.
I don’t think Min/Max works like that anymore… from what I can tell via direct experimentation neither the Helper nor the YAML-configured versions produce a sum attribute.
Set the type to sum so the state will be the sum, do not specify an attribute in the trigger.
I have tried triggering it with input_number (which actually set the state to UNKNOWN since it’s a different type format from the camera counter), and it looks like it’s working. Thanks!