Eufy Camera Integration

It’s no longer working due to changes to the adapter in ioBroker. I have not had time to retry. Please read the whole thread, or at the very least the last month or so.

1 Like

This is great, thank you. I’ve found the groups particularly useful to create a single switch (or groups of switches).

I then moved to HA automations based on device trackers and rest-commands:

e.g., when enter home zone Disarm cameras 1,3,4; when leave set to Home.

(I don’t use Away, Schedule, or Geofencing, and find HA’s location tracking (for geofencing) superior to Eufy’s).

Never have to actually flip a switch again, unless I want to override. And it sends me a notification so I know it did its thing.

alias: My House - Set Eufy Camera 'Location'  to 'Disarm' When Present
description: ''
trigger:
  - platform: zone
    entity_id: person.me
    zone: zone.my_zone
    event: enter
condition: []
action:
  - service: rest_command.eufy_myhome_location_guard_mode_disarmed
  - service: notify.mobile_app_my_iphone
    data:
      message: >-
        It looks like you've arrived. I've set your "Location" camera to
        "Disarmed"
      title: My Home Eufy Cameras
mode: single
1 Like

I open port by port on my firewall when I need it for a new application, so I thought it could be a reason.

Otherwise, I already could access my lan and particulary to the HomeBase 2 with the Eufy application.

But it doesn’t works anymore.

IO Broker works well.

I add that in my configuration.yaml but

sensor:
  - platform: rest
    name: Eufy Doorbell Guard Mode
    resource: "http://HassosIP:8087/getPlainValue/eufy-security.0.T8210XXXXXXXXXXX.station.guard_mode"
    scan_interval: 10
    value_template: >-
      {% set v = value | replace('"', "")|int  %}
      {{ {0: "Away",
          1: "Home",
          2: "Schedule",
          3: "Custom1",
          4: "Custom2",
          5: "Custom3",
          47: "Geofence",
          63: "Disarmed"}[v] | default("Unknown state:" + (value|urlencode)) }}      
  - platform: rest
    name: Eufy Doorbell Stream
    resource: "http://HassosIP:8087/getPlainValue/eufy-security.0.T8210XXXXXXXXXXX.cameras.T8210XXXXXXXXXXX.livestream"
    scan_interval: 10
    value_template: >-
      {% if (value) is not none and (value) != 'error: datapoint "Livestream URL" not found' %}
        {{ value.replace('"', "") }}
      {% else %}
        No Stream
      {% endif %}      

switch:
  - platform: template
    switches:
      eufy_doorbell:
        friendly_name: "Front Door - Guard Mode"
        icon_template: mdi:doorbell-video
        value_template: "{{ is_state('sensor.eufy_doorbell_guard_mode', 'Home') }}"
        turn_on:
          service: rest_command.eufy_doorbell_home
        turn_off:
          service: rest_command.eufy_doorbell_disarmed

rest_command:
  eufy_doorbell_disarmed:
    url: "http://HassosIP:8087/set/eufy-security.0.T8210XXXXXXXXXXX.station.guard_mode?value=GUARD_MODE_VALUE&ack=false"
  eufy_start_stream:
     url: "http://HassosIP:8087/toggle/eufy-security.0.T8210XXXXXXXXXXX.cameras.T8210XXXXXXXXXXX.start_stream"
  eufy_stop_stream:
    url: "http://HassosIP:8087/toggle/eufy-security.0.T8210XXXXXXXXXXX.cameras.T8210XXXXXXXXXXX.stop_stream"
camera:
  - platform: generic
    name: Eufy Doorbell
    still_image_url: http://HassosIP:8082/eufy-security.0/T8210XXXXXXXXXXX.jpg
  - platform: generic
    name: Eufy Doorbell
    still_image_url: http://HassosIP:8082/eufy-security.0/T8210XXXXXXXXXXX.jpg
    stream_source: "{{ states('sensor.eufy__T8210XXXXXXXXXXX_stream') }}"

And a card in one of my views :

But it doesn’t look to works well…please @jbrukardt @MaxW @fuzzymistborn , could you help me please?

Question 1 : Does it works only for https://www.amazon.fr/eufy-Security-Résolution-nécessite-existants/dp/B07R3WY95C
and also for https://www.amazon.fr/gp/product/B08DY9HZ5V/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1 please ?

Question 2 : Which is the IOBROKER_SERVER_IP adress please ? Is it the Home Base IP, the HassOS IP or the IOBroker IP adress of the docker please ?

Question 3 : Must I have to active the RSTP on the cam please ?

Question 4 : Must I choose a less quality on the Eufy App like 1080 HD or 720 HD than 2K because it is too heavy for HA ?

Question 5 :


I suppose it is the station…etc you have with a copy paste of that :
image

Question 6
On Fuzzy link Controlling Eufy Security Devices with ioBroker
The livestream is in text.url :


in mine it’s only url :

When I use the url, here is the result :
image

If I try with : http://HassOSIP:8082/eufy-security.0.T80xxxxxxxxxxxxx.cameras.T81xxxxxxxxxxxxx.hardware_version :
image

Any idea ?

Thanks, I become bored of the Eufy integration :sob: unwhile I integrated lot of others things like ESP, Zwave…Etc…PLEAAAASSE, Helllp :star_struck: :pray:t2:

What do you mean by “changes in ioBroker”? Do you mean I should discard it?

Changes to the adapter. IE there have been improvements/breaking changes made to the code so what I have in my blog post no longer works. There’s likely a way to make it work, it’s just nobody (that I’ve seen) has posted it.

I went up one by one the 1100 posts in this thread and found this one.
I have exactly the same issue, so have uninstalled everything and reinstalled everything but the issue is not solved.
I do have installed ioBroker Eufy Security version 0.5.2.
I have set (in the Eufy app) the quality of streaming video to “Low” and the quality of recording video to “Full HD (1080p)” - only 2 choices proposed 2K and Full HD.
In the log I see that the video is in H264 but it looks like there is issue with codec or something.
Do you know how to update FFMEG to the latest version as suggested in the log ?
TIA
Edit: I thought the issue is linked with audio, so unchecked the audio recording. Manage to obtain once the stream - don’t know how - but only once, then again unable to obtain the stream.

2021-04-18 11:54:29.446 - error: eufy-security.0 (6239) ffmpegStreamToHls(): An error occurred: ffmpeg exited with code 1:
2021-04-18 11:54:29.447 - error: eufy-security.0 (6239) ffmpegStreamToHls(): ffmpeg output:
2021-04-18 11:54:29.447 - error: eufy-security.0 (6239) ffmpegStreamToHls(): ffmpeg stderr:
ffmpeg version 4.3.2-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 8 (Debian 8.3.0-6)
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzimg
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
[h264 @ 0x1f6e90a0] error while decoding MB 94 67, bytestream -5
[h264 @ 0x1f6e90a0] concealing 75 DC, 75 AC, 75 MV errors in I frame
Input #0, h264, from 'unix:/tmp/eufy-security.0.1.sock':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080, 24 fps, 24 tbr, 1200k tbn, 48 tbc
[aac @ 0x1f6e9a90] More than one AAC RDB per ADTS frame is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x1f6e9a90] channel element 1.7 is not allocated
[aac @ 0x1f6e9a90] channel element 2.2 is not allocated
[aac @ 0x1f9ec900] decoding for stream 0 failed
[aac @ 0x1f9ec900] Could not find codec parameters for stream 0 (Audio: aac (LTP), 5.0, fltp, 45 kb/s): unspecified sample rate
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #1, aac, from 'unix:/tmp/eufy-security.0.2.sock':
Duration: N/A, bitrate: 45 kb/s
Stream #1:0: Audio: aac (LTP), 5.0, fltp, 45 kb/s
[hls @ 0x1f713d80] sample rate not set
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #1:0 -> #0:1 (copy)
Last message repeated 1 times
2021-04-18 11:54:29.449 - error: eufy-security.0 (6239) EufySecurity.onStartLivestream(): station: Txxxxxxxxxxxxxxx channel: 0 - Error: Error: ffmpeg exited with code 1: - Stopping livestream...

Does anyone have an idea please ? 3 weeks looking for a solution…I am quite bored :roll_eyes:

Me too… :pensive:
I’ve just bought an Arlo Essential, more expensive than Eufy but way easier to integrate into HA and there is also a doorbell… Although no “pan & tilt” feature which I appreciate much in the Eufy camera range.

1 Like

you are kind of all over the place with your code. I think you need to start from scratch with small goals.

What is the first thing you would like to do with your cameras?

Integrate them into home assistant :upside_down_face:

Thx for your advices, my code only repeats the 2 tutorials mentioned by Fuzzy and MaxW for a camera. So, it looks difficult to do much less :wink:

integrate them how? There are three main things

  1. View a stream
  2. Change variables (guard mode, enabled, etc)
  3. Receive notifications (crying, motion detected, etc)

Each one has its own code path.

I peronally would like to see the last motion still picture and on click the stream (and e.g. integrate it in push message, if I have the working stream url)). That’s it.

More or less what is working with the old Eufy Security integration, but without the problems of having to start the stream manually, reload the page, etc. to see the stream. Beside all the warnings in the log, this one is running still very fine. And all this without iobroker. :wink:

2 Likes

Thx jbrukardt, same things of @arganto , I need the stream which, I think having understood that should works in an explorer with :
http://HassosIP:8087/getPlainValue/eufy-security.0.T8210XXXXXXXXXXX.cameras.T8210XXXXXXXXXXX.livestream
by replacing that copy-paste after “Value/” of that:
image
and replacing HassOSIP by the Hass’host IP, isn’t it ?

ok, theres going to be a couple steps here

  1. Verify you have IObroker access from HA. Have you configured the ports correctly in the iobroker addon configuration? Do you have 8082 mapped to 8082, and 8086 mapped to 8087?
1 Like

thank you buddy, all my hope is on you :+1:t2:

Indeed, my port 8087 was forwarded from my 8087 … first error which in terms of addressing can explain that I did not have access. I come back to the news asap :hugs:

New config:
image

I used Home Assistant Supervised rather than the HASSos image, so i may not have the IP addresses right. To access home assistant addons from HA, i use the same IP I use for HA, with the port for the addon. Im not sure if HASSos does the same thing.

strike that 8086 to 8087 guidance! It looks like MaxW has updated his addon so you can do 8087:8087 mapping. Sorry about that, switch it back.

We’re going to see if your rest commands are working.

In a browser, put the following in the address bar and hit enter:

http://whateveraddressyouaccessiobrokerwith:8087/getPlainValue/copypastedvalueyoumentioned

Cut and paste two things here:

That address above (anonymized)
The web response you get back, it should be an rmtp stream address.

Ok, so back to the top :sweat_smile:

Here is the error message, 2 things bother me:

The date isn’t my HassOS date and the GetPlainValue command looks to be wrong :roll_eyes:

with a getPlainValue (casse different), the message is that one :
image

ok, lets try another variable that i know works. find the device enabled variable, or the guard mode variable and use the copy button on that, then paste your string in

1 Like

It works with another value :wink:
http://HassOSIP:8087/getPlainValue/eufy-security.0.T8xxxxxxxxxxxxxx.cameras.T8xxxxxxxxxxxxxx.last_charge_saved_events returns :
image

For:

With an other variable :
http://HassOSIP:8082/eufy-security.0/HomeBaseSN/last_event/CameraSN.jpeg


Du coup j’arrive à afficher une image dans HassOs mais quand je clique dessus :

Meanwhile, in an explorer :
image
Then F5 :
image

Update :
I put “true” in the « button start : start stream » value then, a link appeared :

In the explorer :
image

Question : is-it necessary to have a file in home assistant to the stream ?

Question 2 : is there a User file in Iobroker to configure or create ? I’ll see tonight but if somebody have the answer, it should be great :star_struck:

ok, all that is good news. your iobroker and rest interface is working as designed.

Put the following two sections in your yaml files

rest_command:

# Start/Stop EufyCam Streams
# Enable/Disable EufyCams

  eufy_disabled:
    url: "http://iobrokerip:8087/set/eufy-security.0.T8xxxxxxxxxxxxxx.cameras.T8xxxxxxxxxxxxxx.device_enabled?value=false"
  eufy_enabled:
    url: "http://iobrokerip:8087/set/eufy-security.0.T8xxxxxxxxxxxxxx.cameras.T8xxxxxxxxxxxxxx.device_enabled?value=true"

and

binary_sensor:

  - platform: rest
    name: Eufy Power
    resource: "http://iobrokerip:8087/getPlainValue/eufy-security.0.T8xxxxxxxxxxxxxx.cameras.T8xxxxxxxxxxxxxx.device_enabled"
    scan_interval: 10

Then after you have those in the configuration.yaml (or whatever !included file you use for binary_sensor: and rest_command: confirm your config.yaml checks out, restart HA

Step 1 : Go to Developer Tools > States > and type binary.sensor_eufy_power in the entity box. It should start auto-filling at some point when you’re typing and you can just click it.

It should show the state (on or off) in the state box below entity, and a last changed detail to the right of that.

If all that works, you know you have HA talking to IObroker right

Next, you want to try to change the state.

Step 2: Go to Developer Tools > Services > and type rest_command.eufy_disabled in the service box. It should start auto-filling at some point when you’re typing and you can just click it as with step 1.

Click call service

it should flip the state of the eufy_cam to disabled.

Step 3: repeat step 2 and see if it now says “off” rather than on

1 Like