I am attempting to lock my front door using a z-wave yale lock when triggering this scene
- name: Goodnight
entities:
group.lights: off
switch.living_room_fan_switch: off
media_player.apple_tv: off
switch.garage_light: off
lock.front_door_lock_locked: lock
This results in the following error:
[homeassistant.helpers.state] reproduce_state: Unable to reproduce state <state lock.front_door_lock_locked=lock
I then switched to trying to trigger an automation using the scene event as a trigger:
- id: lock_door_using_scene
alias: Lock Front Door Using Scene
trigger:
- platform: event
event_type: call_service
event_data:
service_data:
entity_id: scene.goodnight
domain: scene
service: turn_on
action:
- service: lock.lock
entity_id: lock.front_door_lock_locked
This works when I turn_on the scene via the service panel in the web app but does not work when I invoke the scene using Alexa. The scene is turned on but the automation never triggers.
I’m using Alexa via emulated_hue:
emulated_hue:
off_maps_to_on_domains:
- script
- scene
exposed_domains:
- scene
- input_boolean
- switch
My full configuration can be found here https://github.com/lucasweb78/home-assistant-config
Questions:
- Why did using the scene to trigger the lock service not work?
- Why do I not get the scene turn_on event when using Alexa but I do when triggering in in the service panel?
- Is there a better way to achieve what I’m trying to do?
Thanks in advance
UPDATE
Looking through the logs, this is what happens when using Alexa
2017-09-02 07:54:59 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=homeassistant, service=turn_on, service_data=entity_id=scene.going_to_bed, service_call_id=4480884632-35>
2017-09-02 07:54:59 DEBUG (MainThread) [homeassistant.components.api] STREAM 4489665632 FORWARDING <Event call_service[L]: domain=scene, service=turn_on, service_data=entity_id=['scene.going_to_bed'], service_call_id=4480884632-36>
2017-09-02 07:54:59 DEBUG (MainThread) [homeassistant.components.api] STREAM 4489665568 WRITING data: {"event_type": "call_service", "data": {"domain": "scene", "service": "turn_on", "service_data": {"entity_id": ["scene.going_to_bed"]}, "service_call_id": "4480884632-36"}, "origin": "LOCAL", "time_fired": "2017-09-02T14:54:59.311188+00:00"}
2017-09-02 07:54:59 DEBUG (MainThread) [homeassistant.components.api] STREAM 4489665600 WRITING data: {"event_type": "call_service", "data": {"domain": "scene", "service": "turn_on", "service_data": {"entity_id": ["scene.going_to_bed"]}, "service_call_id": "4480884632-36"}, "origin": "LOCAL", "time_fired": "2017-09-02T14:54:59.311188+00:00"}
2017-09-02 07:54:59 DEBUG (MainThread) [homeassistant.components.api] STREAM 4489665616 WRITING data: {"event_type": "call_service", "data": {"domain": "scene", "service": "turn_on", "service_data": {"entity_id": ["scene.going_to_bed"]}, "service_call_id": "4480884632-36"}, "origin": "LOCAL", "time_fired": "2017-09-02T14:54:59.311188+00:00"}
2017-09-02 07:54:59 DEBUG (MainThread) [homeassistant.components.api] STREAM 4489665632 WRITING data: {"event_type": "call_service", "data": {"domain": "scene", "service": "turn_on", "service_data": {"entity_id": ["scene.going_to_bed"]}, "service_call_id": "4480884632-36"}, "origin": "LOCAL", "time_fired": "2017-09-02T14:54:59.311188+00:00"}
this is what happens when using the service panel
017-09-02 07:56:35 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=scene, service=turn_on, service_data=entity_id=scene.going_to_bed, service_call_id=4480884632-43>
2017-09-02 07:56:35 DEBUG (MainThread) [homeassistant.components.api] STREAM 4489665568 FORWARDING <Event call_service[L]: domain=scene, service=turn_on, service_data=entity_id=scene.going_to_bed, service_call_id=4480884632-43>
2017-09-02 07:56:35 DEBUG (MainThread) [homeassistant.components.api] STREAM 4489665600 FORWARDING <Event call_service[L]: domain=scene, service=turn_on, service_data=entity_id=scene.going_to_bed, service_call_id=4480884632-43>
2017-09-02 07:56:35 DEBUG (MainThread) [homeassistant.components.api] STREAM 4489665616 FORWARDING <Event call_service[L]: domain=scene, service=turn_on, service_data=entity_id=scene.going_to_bed, service_call_id=4480884632-43>
2017-09-02 07:56:35 DEBUG (MainThread) [homeassistant.components.api] STREAM 4489665632 FORWARDING <Event call_service[L]: domain=scene, service=turn_on, service_data=entity_id=scene.going_to_bed, service_call_id=4480884632-43>
2017-09-02 07:56:35 DEBUG (MainThread) [homeassistant.components.api] STREAM 4489665568 WRITING data: {"event_type": "call_service", "data": {"domain": "scene", "service": "turn_on", "service_data": {"entity_id": "scene.going_to_bed"}, "service_call_id": "4480884632-43"}, "origin": "LOCAL", "time_fired": "2017-09-02T14:56:35.484596+00:00"}
2017-09-02 07:56:35 DEBUG (MainThread) [homeassistant.components.api] STREAM 4489665600 WRITING data: {"event_type": "call_service", "data": {"domain": "scene", "service": "turn_on", "service_data": {"entity_id": "scene.going_to_bed"}, "service_call_id": "4480884632-43"}, "origin": "LOCAL", "time_fired": "2017-09-02T14:56:35.484596+00:00"}
2017-09-02 07:56:35 DEBUG (MainThread) [homeassistant.components.api] STREAM 4489665616 WRITING data: {"event_type": "call_service", "data": {"domain": "scene", "service": "turn_on", "service_data": {"entity_id": "scene.going_to_bed"}, "service_call_id": "4480884632-43"}, "origin": "LOCAL", "time_fired": "2017-09-02T14:56:35.484596+00:00"}
2017-09-02 07:56:35 DEBUG (MainThread) [homeassistant.components.api] STREAM 4489665632 WRITING data: {"event_type": "call_service", "data": {"domain": "scene", "service": "turn_on", "service_data": {"entity_id": "scene.going_to_bed"}, "service_call_id": "4480884632-43"}, "origin": "LOCAL", "time_fired": "2017-09-02T14:56:35.484596+00:00"}
2017-09-02 07:56:35 INFO (MainThread) [homeassistant.components.automation] Executing Lock Front Door Using Scene
2017-09-02 07:56:35 INFO (MainThread) [homeassistant.core] Bus:Handling <Event logbook_entry[L]: name=Lock Front Door Using Scene, message=has been triggered, domain=automation, entity_id=automation.lock_front_door_using_scene>
It appears the stream is only forwarded once when using Alexa STREAM 4489665632 FORWARDING
but 4 times when using the service panel:
2017-09-02 07:56:35 DEBUG (MainThread) [homeassistant.components.api] STREAM 4489665568 FORWARDING <Event call_service[L]: domain=scene, service=turn_on, service_data=entity_id=scene.going_to_bed, service_call_id=4480884632-43>
2017-09-02 07:56:35 DEBUG (MainThread) [homeassistant.components.api] STREAM 4489665600 FORWARDING <Event call_service[L]: domain=scene, service=turn_on, service_data=entity_id=scene.going_to_bed, service_call_id=4480884632-43>
2017-09-02 07:56:35 DEBUG (MainThread) [homeassistant.components.api] STREAM 4489665616 FORWARDING <Event call_service[L]: domain=scene, service=turn_on, service_data=entity_id=scene.going_to_bed, service_call_id=4480884632-43>
2017-09-02 07:56:35 DEBUG (MainThread) [homeassistant.components.api] STREAM 4489665632 FORWARDING <Event call_service[L]: domain=scene, service=turn_on, service_data=entity_id=scene.going_to_bed, service_call_id=4480884632-43>
Although I’m not really sure what that means