I’m absolutly new to MQTT and I’m trying to make an automation that triggers only if the MQTT "event": "sleep_tracking_stopped"
is triggered. I found that the MQTT event looks like this in the MQTT Broker
Message 15 received on SleepAsAndroid at 9:26 PM:
{
"event": "sleep_tracking_stopped"
}
I’m guessing the code must look something like this, but I’m not quite there:
description: Test
mode: single
trigger:
- platform: mqtt
topic: SleepAsAndroid
condition:
- condition: template
value_template: "value_template: '{{ "event" == "sleep_tracking_started"}}'
action:
- type: toggle
device_id: xxxxxx
entity_id: light.licht_arbeitszimmer_standlampe_light
domain: light