I tried to setup a check automation, if my zigbee device is still reporting action/values, or if it lost the connection.
Therefore I tried to build an automation which looks like the code below, but it returns me an data error message.:
" Message malformed: required key not provided @ data[‘action’] "
Is it possible to use variables within an automation?
THX for the help
description: |-
Trigger Time
0900
1200
1500
1800
2100
2400
0300
mode: single
trigger:
- platform: time
at: "09:00:00"
- platform: time
at: "12:00:00"
- platform: time
at: "15:00:00"
- platform: time
at: "18:00:00"
- platform: time
at: "21:00:00"
- platform: time
at: "00:00:00"
- platform: time
at: "03:00:00"
condition: []
action:
- alias:
variables:
actualtemp: {{ state_attr('climate.lumi_lumi_airrtc_agl001_thermostat', 'temperature')|float }}
- service: climate.set_temperature
data:
temperature: >-
{{ state_attr('climate.lumi_lumi_airrtc_agl001_thermostat',
'temperature')|float + 0.5 }}
target:
device_id: ba56c38bd877e0f30ac8219f1489f504
- delay:
hours: 0
minutes: 0
seconds: 2
milliseconds: 0
- if:
- condition: template
value_template: "{{ state_attr('climate.lumi_lumi_airrtc_agl001_thermostat', 'temperature')|float == actualtemp }}"
then:
- service: notify.marceltelegram
data:
message: Zigbee Thermostat Error
title: "*Warning*"
else:
- service: climate.set_temperature
data:
temperature: >-
{{ state_attr('climate.lumi_lumi_airrtc_agl001_thermostat',
'temperature')|float - 0.5 }}
target:
device_id: ba56c38bd877e0f30ac8219f1489f504