I do use the turn off, but nothing happens.
The following code doesn’t seem to work.
- alias: '[Frontyard] Cube Shake - Stream Camera'
trigger:
- event_data:
action_type: shake_air
entity_id: binary_sensor.cube_xxxxxxxxxxxx
event_type: xiaomi_aqara.cube_action
platform: event
action:
- service: media_player.turn_on
entity_id: media_player.chromecast_kitchen
- service: camera.play_stream
data:
entity_id: camera.drivein
media_player:
- media_player.chromecast_kitchen
- delay:
seconds: 30
- service: media_player.turn_off
entity_id: media_player.chromecast_kitchen
It does turn on the Chromecast and then the screen shows the cast icon, but that’s about it.
No stream and it certainly doesn’t do the turn off command. I can afterwards manually in my lovelace click turn off and then follow my command.
I see this error though in my log:
Error while executing automation automation.frontyard_cube_shake_stream_camera. Unknown error for call_service at pos 2:
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/automation/init.py”, line 380, in action
await script_obj.async_run(variables, context)
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/script.py”, line 131, in async_run
await self._handle_action(action, variables, context)
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/script.py”, line 210, in _handle_action
action, variables, context)
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/script.py”, line 299, in _async_call_service
context=context
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/service.py”, line 88, in async_call_from_config
domain, service_name, service_data, blocking=blocking, context=context)
File “/usr/local/lib/python3.7/site-packages/homeassistant/core.py”, line 1138, in async_call
self._execute_service(handler, service_call))
File “/usr/local/lib/python3.7/site-packages/homeassistant/core.py”, line 1160, in _execute_service
await handler.func(service_call)
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_component.py”, line 188, in handle_service
self._platforms.values(), func, call, service_name
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/service.py”, line 314, in entity_service_call
future.result() # pop exception if have
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/service.py”, line 330, in _handle_service_platform_call
await func(entity, data)
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/camera/init.py”, line 644, in async_handle_play_stream_service
keepalive=camera_prefs.preload_stream)
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/stream/init.py”, line 56, in request_stream
raise HomeAssistantError(“Stream component is not set up.”)
homeassistant.exceptions.HomeAssistantError: Stream component is not set up.
But, since I added the Ubiquiti Protect Camera as a Generic as described in the guide, I shouldn’t use the stream component as far as I could read?
What have I messed up?