Ding Dong...
This weekends mission was to connect up a new smart doorbell. The requirements - It was replacing a main powered door bell with an analogue chime. The current doorbell ran from a transformer that gave 8Volts, 1amp. The new door bell should replace this one, use the existing wires, use the existing chime and also allow a new chime elsewhere in the house. The storage should be local and not cloud based. There should be a free phone app to answer and talk back to the visitor. And finally - bonus points if I can cast the picture to a TV when it rings using Home Assistant.
After watching lots of you-tube reviews and reading lots of spec sheets on the hundred of similar looking devices I picked the Eufy 2K battery/wired doorbell : https://www.amazon.co.uk/gp/product/B081VD7VVZ It connected to the chime and my phone in minutes. It has a battery and trickle charges it from the 8V supply.
First step - Install the eufy-security integration : https://github.com/nonsleepr/ha-eufy-security and then add on a bridge to carry the eufy updates to mqtt (note there is a separate port about installing and using mqtt): https://github.com/matijse/eufy-ha-mqtt-bridge/
And add some sensors to the configuration.yaml file :
# Doorbell stuff : binary_sensor: - platform: mqtt name: Camera motion detected device_class: motion state_topic: homeassistant/binary_sensor/eufy/T8210PXXXXXXXXXX_motion/state json_attributes_topic: homeassistant/binary_sensor/eufy/T8210PXXXXXXXXXX_motion/attributes payload_on: motion payload_off: clear off_delay: 5 - platform: mqtt name: Doorbell button pressed device_class: motion state_topic: homeassistant/binary_sensor/eufy/T8210PXXXXXXXXXX_doorbell/state json_attributes_topic: homeassistant/binary_sensor/eufy/T8210PXXXXXXXXXX_doorbell/attributes payload_on: motion payload_off: clear off_delay: 5 camera: - platform: mqtt name: Camera - Last event topic: homeassistant/camera/eufy/T8210PXXXXXXXXXX_thumbnail
Add an automation that will trigger when someone rings the doorbell (or you could use 'motion detect') and pass it to a command that will send it out to the TV :
alias: FrontDoor - Motion - LivingRoom TV description: '' trigger: - platform: state entity_id: binary_sensor.front_door_doorbell_pressed attribute: event_time condition: [] action: - service: rest_command.doorbell_tv data: message: Someone at the front door tv: 192.168.0.200 pic: "https://Address-Goes-here{{state_attr("camera.front_door_last_event","entity_picture")}}" mode: single
And here is the command this will run (taken almost directly from https://community.home-assistant.io/t/eufy-camera-integration/ ) rest_command: doorbell_tv: url: "http://{{ tv }}:7979/notify" content_type: 'application/json' verify_ssl: false method: 'post' timeout: 20 payload: > { "duration": 5, "position": 0, "title": "Home Assistant", "titleColor": "#50BFF2", "titleSize": 10, "message": "{{ message }}", "messageColor": "#fbf5f5", "messageSize": 14, "backgroundColor": "#0f0e0e", "media": { "image": { "uri": "{{pic}}","width": 580 }} } This then uses the PIPUP android TV plugin to do a floating (picture in picture) box to show who is walking up. https://github.com/rogro82/PiPup
At this point I ran into trouble. If I put in an image form a public website - it worked. If I tried anything local it would not work. I searched and searched and could fine almost nothing on the subject.
After a few hours of testing, I worked out it was not an issue with remote Vs local addresses. It has HTTPS. Even though the examples show 'http://192.168.x.x/' type addresses this would not work on the two TVs I tested on. You need HTTPS not HTTP and for that you need a valid DNS name and Cert to go with it.
So I changed my picture from : http://192.168.0.50{{state_attr("camera.front_door_last_event","entity_picture")}}"
to :
https://Address-Goes-here{{state_attr("camera.front_door_last_event","entity_picture")}}"
I registered the DNS address with a Free DNS service and registered an SSL cert with letsEncrypt. and installed it using the following HACS plugins : https://github.com/home-assistant/hassio-addons/tree/master/letsencrypt https://github.com/home-assistant/hassio-addons/tree/master/duckdns and finally got the HTTPS service running using : https://github.com/home-assistant/hassio-addons/tree/master/nginx_proxy This last bit may be optional. try your tv first to see if it displays the picture with the local address of your HA box. If it gives the text but no picture you need to do the above.
















