Hey everyone, glad to see my original post is helping everyone out there. Even though the walkthrough here uses BlueIris I want everyone to know you can also do the same using the Hassio MotionEye addon. This is fully open source.
If you want to go down this route do not use a Raspberry Pi and instead run Hassio on a Virtual Machine which is far, far more powerful. If you’re interested in migrating to a Hassio Virtual Machine look here: My migration to improve Hassio performance and increase security
I’m not sure if you have the same Vizio cast as me (depends on the model I think), but I went down the same route in trying to cast to my Vizio TV (VIZIO 55 Inch LED Smart TV D55-D2 HDTV), but the implementation on my TV of Chromecast is not the same implementation as a Chromecast (either the stick or in a TV that runs Android TV. Therefore in my case you can’t cast as you would normally. The strange thing is I can cast from an Android device. YMMV, but I couldn’t get it working.
Hi, just got a lenovo smart display and looking to do similar setup where motion detected to display on the smartdisplay. How you tying the trigger of motion? Did you use similar setup as your OP? Thanks.
Sorry should of been more clear, using blue iris as well. Are you using mqtt to do that? Looking to setup when alerted on BI to cast to a display. Just haven’t been able to find a right setup or config.
If you are willing to share that config. Also with your code above I get everything but the “Execute button” what am I missing? not getting any config errors. Thanks.
Seems you’re pretty new to Home Assistant. I recommend you get the basics of understanding how to add devices to home assistant first, then learning about how scripts works and then to automations. The combination of these 3 things will get you what you need.
You’re essentially learning to code and its not as straight forward as your request assumes.
Hello Everyone out there reading this thread. After the release of Home Assistant v0.91, there’s a much better way to do this with native integration to the Google Assistant via Blue Iris.
If you do the above and expose your “camera.device” to the Google Assistant you’ll see it exposed in the Home App as a natively integrated camera. What this means if you have multiple smart displays in your home you can execute the following commands:
“OK Google, show me the baby camera” and it will know which device you’re interacting with and show it on that display.
“OK Google, show the baby camera on the TV Chromecast” and it should be smart enough to execute this action.
(note: The remaining sections need to be duplicated for each camera.)
You’ll need to create binary_sensor(s) for BI to manipulate:
binary_sensor:
- platform: template
sensors:
motion_CAMERA:
value_template: >
{% if states.binary_sensor.motion_CAMERA.state %}
{% if is_state('binary_sensor.motion_CAMERA', 'on') %}
on
{% elif is_state('binary_sensor.motion_CAMERA', 'off') %}
off
{% else %}
{{ states('binary_sensor.motion_CAMERA') }}
{% endif %}
{% else %}
off
{% endif %}
For your camera(s) in BI:
Go to “Properties” > “Alerts” and in the “Actions” section place a check in the box next to “Post to a web address or MQTT server”
Click “Configure”, choose http:// or https:// for both fields according to your HA configuration
Check “Alert again when trigger is reset”
In both fields next to http:// (or https://) enter:
HA_IP_ADDRESS:8123/api/states/binary_sensor.motion_&CAM?api_password=API_PASSWORD
(note: BI will automatically replace “&CAM” with the camera’s “Short name”, which can be found in “Camera Properties…” under the “General” tab. This name must correspond to the “_CAMERA” name(s) configured in the binary_sensor: section [which are also referenced in the automation: section].)
In the first Post/payload: field enter {"state":"on"}.
In the second Post/payload: field enter {"state":"off"}.
eg:
And lastly, create automations to start / stop Casting:
automation:
- alias: CAMERA Start Casting
initial_state: true
trigger:
- platform: state
entity_id: binary_sensor.motion_CAMERA
to: "on"
action:
- service: media_player.play_media
data_template:
entity_id: media_player.CAST_DEVICE
media_content_id: "http://BI_IP_ADDRESS:PORT/mjpg/CAMERA"
media_content_type: "image/jpg"
- alias: CAMERA Stop Casting
initial_state: true
trigger:
- platform: state
entity_id: binary_sensor.motion_CAMERA
to: "off"
action:
- service: media_player.media_stop
entity_id: media_player.CAST_DEVICE
Thank you for the detailed write up helps a lot, just having one issue with the automation part that it’s not liking. Not sure if I missed something? This is the error given.
" Invalid config for [automation]: [media_content_id] is an invalid option for [automation]. Check: automation->action->0->media_content_id. (See /config/configuration.yaml, line 72)."
I pieced this together by pruning some more complex configurations I had implemented (before moving them to Node-Red) so I haven’t tested these specific configurations. Did you implement every step that you can confirm as working?
OK so service_template: didn’t work. I was using separate start / stop automations for an unrelated reason but I vaguely remember having trouble at some point with syntax variations between how play_media and media_stop are called.
Thanks for reporting back. I’ll edit the post to include separate start / stop automations.