So my automation is running as it should. All I’m trying to work out is why I’m getting the error.
This is my automation now (I’ve changed it slightly to allow play/pause of my media player)
- id: 'masterswitch'
hide_entity: true
alias: Toggle lights on and off
trigger:
- platform: state
entity_id: sensor.0x00158d00034039aa_click
condition: []
action:
service_template: >
{% if (trigger.to_state.state == "single") and (is_state('media_player.the_ultra', 'on')) %}
media_player.media_play_pause
{% else %}
light.toggle
{% endif %}
data_template:
entity_id: >
{% if (trigger.to_state.state == "single") and (is_state('media_player.the_ultra', 'on')) %}
media_player.the_ultra
{% elif trigger.to_state.state == "double" %}
light.upstairs_lounge
{% elif trigger.to_state.state == "triple" %}
light.upstairs_bedroom
{% elif trigger.to_state.state == 'quadruple' %}
light.upstairs_lounge, light.upstairs_bedroom
{% endif %}
This is my zigbee2mqtt log when I click something:
zigbee2mqtt:info 9/7/2019, 1:16:52 PM MQTT publish: topic 'zigbee2mqtt/0x00158d00034039aa', payload '{"linkquality":97,"battery":100,"voltage":3012,"click":"double"}'
zigbee2mqtt:info 9/7/2019, 1:16:52 PM MQTT publish: topic 'zigbee2mqtt/0x00158d00034039aa', payload '{"linkquality":97,"battery":100,"voltage":3012,"click":""}'
This is my developer tools info log when I click something
Log Details (ERROR)
Sat Sep 07 2019 13:16:46 GMT+1200 (New Zealand Standard Time)
Error while executing automation automation.toggle_lights_on_and_off. Invalid data for call_service at pos 1: not a valid value for dictionary value @ data['entity_id']
And if I get it to show my full logs
2019-09-07 13:18:38 ERROR (MainThread) [homeassistant.components.automation] Error while executing automation automation.toggle_lights_on_and_off. Invalid data for call_service at pos 1: not a valid value for dictionary value @ data['entity_id']
So just to confirm, the automation does run, it does to what I want it to, but I’m getting the above error in my logs as well. Is there any other information I can provide that might help? Or is it just something I don’t need to worry about since my automation runs anyway?