Hi All,
This is driving me crazy, I am trying to create an automation that will run if I toggle the light in any room three times, so I created a state trigger that includes all the lights in different rooms, and I want to create a “wait_for” action that will wait for the light in the same room to be toggled two more times, however, the trigger.entity_id is not working for me at all , even though it’s working perfectly in the TTS announcement below and the telegram notification.
Whenever I try to save the automation, I get an error message:
“Message malformed: Entity [object Object] is neither a valid entity ID not a valid UUIT for dictionary values @data[‘entity_id’]”
I also tried to use the below but none worked:
{{trigger.to_state.entity_id}}
{{trigger.to_state.object_id}}
alias: Room_Cleaning (Duplicate)
description: ''
trigger:
- platform: state
entity_id:
- light.master_bedroom_light
- light.yusuf_bedroom_light
- light.kitchen_light
- light.meals_room_light
- light.living_room_light
- light.bathroom
condition: []
action:
- wait_for_trigger:
- platform: state
entity_id: {{trigger.entity_id}}
timeout: '3'
continue_on_timeout: false
- wait_for_trigger:
- platform: state
entity_id: {{trigger.entity_id}}
timeout: '3'
continue_on_timeout: false
- service: tts.google_translate_say
data:
entity_id: media_player.yusuf_bedroom
message: >-
Starting cleaning in {{ area_name(trigger.entity_id) }} which is area
number {{(state_attr('input_text.cleaning_areas',
'pattern')|from_json)[area_id(trigger.entity_id)]}}
- service: notify.telegram
data:
message: >-
Starting cleaning in {{ area_name(trigger.entity_id) }} which is area
number {{(state_attr('input_text.cleaning_areas',
'pattern')|from_json)[area_id(trigger.entity_id)]}}
mode: single
Please help