Bonjour,
je suis en train de tester les notification IOS avec possibilité de répondre en fonction de ce que l’on programme, je voulais essayer simple pour débuter … juste un on/off d’une lumière … en partant de l’exemple du site de HA :
https://companion.home-assistant.io/docs/notifications/actionable-notifications
# inside a automation actions or script sequence - alias: "Set up variables for the actions" variables: # Including an id in the action allows us to identify this script run # and not accidentally trigger for other notification actions action_on: "{{ 'ON_' ~ context.id }}" action_off: "{{ 'OFF_' ~ context.id }}" - alias: "Ask to close or open the blinds" service: notify.mobile_app_iphone_de_stephane data: message: "Faut il allumer la lumière ?" data: actions: - action: "{{ action_on }}" title: Allumer - action: "{{ action_off }}" title: Eteindre - alias: "Wait for a response" wait_for_trigger: - platform: event event_type: mobile_app_notification_action event_data: # waiting for the specific action avoids accidentally continuing # for another script/automation's notification action action: "{{ action_on }}" - platform: event event_type: mobile_app_notification_action event_data: action: "{{ action_off }}" - alias: "Perform the action" choose: - conditions: "{{ wait.trigger.event.data.action == action_on }}" sequence: - service: light.turn_on target: entity_id: light.bleu_salle_tele - conditions: "{{ wait.trigger.event.data.action == action_off }}" sequence: - service: light.turn_off target: entity_id: light.bleu_salle_tele
j’ai mis tout ce code dans un script
et au moment de l’enregistrer j’ai un message d’erreur :
erreur : Message malformed: expected a dictionary
alors j’avoue que je sèche un peu, je ne vois pas trop où j’ai fait un bug !!
une idée ?