Can anybody give me a hint, what I am doing wrong. I want to invoke a MQTT Message when a Value (mileage of my car) is changing. I made thist config, but it only works at the configured time at 23:59h. There is no update when the mileage is going up.
Here you can find the YAML Code of the automation:
alias: 'Audi KM Stand Änderung '
description: Audi KM Stand Änderung zu IP Symcon
trigger:
- type: value
platform: device
device_id: f702140dd6727c59e1d75c9879f72301
entity_id: sensor.audi_a6_55_tfsie_mileage
domain: sensor
above: 1
id: sensor.audi_a6_55_tfsie_mileage
- platform: time
at: '23:59'
condition: []
action:
- service: mqtt.publish
data:
payload_template: '{{ states.sensor.audi_a6_55_tfsie_mileage.state }}'
topic: /home-assistant/audi/mileage
mode: single
will only fire when the value crosses from below 1 to above 1. Going from 4 to 5 for example will not cause it to fire.
If you want to trigger on every change, use this trigger:
- type: value
platform: state
entity_id: sensor.audi_a6_55_tfsie_mileage
This will fire every time the state (or any of the sensor’s attributes) changes. If the attribute changes are an issue we can add a condition to reject that.
alias: 'Audi KM Stand Änderung '
description: Audi KM Stand Änderung zu IP Symcon
trigger:
- type: value
platform: state
entity_id: sensor.audi_a6_55_tfsie_mileage
- platform: time
at: '23:59'
condition: []
action:
- service: mqtt.publish
data:
payload_template: '{{ states.sensor.audi_a6_55_tfsie_mileage.state }}'
topic: /home-assistant/audi/mileage
mode: single
And get the error message: Message malformed: extra keys not allowed @ data[‘type’]