Closed leo4417 closed 11 months ago
The var object is not an automation. However, it get's updated when the tracked_entity_id is triggered. In other words: if you add sensor.temperature to the tracked_entity_id, you don't need the automation and it will be updated when sensor.temperature state changes. This would do the trick:
var:
temp_sensor_battery:
friendly_name: "Temp Sensor Battery"
value_template: "{{ state.attr('sensor.temperature', 'battery') }}"
tracked_entity_id:
- sensor.temperature
I would like to write the value of sensor (total_current) to variable x at sunset and the value at sunrise to variable y.
The difference gives me the power consumption over night.
Your script should be a good idea, I installed your integration - but where do I put the code below? If I write an automation, it was the wrong configuration. Could you help me?