This sensor tracks when my phone is connected to the car, I’d like to use this data to track my commuting time. Basically I’d like to mimic the utility meter functionality (having a daily, weekly, monthly, yearly count).
I guess I could use the utility meter platform but then I would need to be able to measure the minutes the sensor is connected to the car. Is there an easy way to do this? Or perhaps is there a better way to pull out this information from the sensor?
What I ideally would want is as soon as the sensor goes from on to off state, the value (in the last case) of a given sensor or attribute is “21 minutes”. In such a case I can e.g. send a push notification to my phone with a msg on how long the drive was.
To make matters more complicated , as a second thing, I actually only want to track when my phone is connected to the car, not e.g. to my headphones (so also based on the ‘last device name’ or mac)
Make one automation which is triggered by sensor-“on”, another automation is triggered by sensor-“off”. Then in the “on”-Automation you check attributes.last_triggered of the “off”-Automation and vice versa.
Hi Looks great. Can you tell me where to put both codes? First one in templates in Settings and second one in configuration.yaml? I get an error with “variable”. I have the addon installed…