matijse / eufy-ha-mqtt-bridge

Receive Eufy alerts and thumbnails in Home Assistant via MQTT
124 stars 25 forks source link

How to run along with hass.io? // Create addon? #1

Closed MaxWinterstein closed 3 years ago

MaxWinterstein commented 3 years ago

Hi @matijse,

coming from https://community.home-assistant.io/t/eufy-camera-integration/121758/488 where we discuss how to get the eufy cams and stuff integrated this repository was mentioned.

First of all, I love the idea of using MQTT discovery!

As this needs some more advanced user currently to run, I am interested in the plans for this. Will this be some integration? Addon?

I might help you with that if interested?

Greetings Max

matijse commented 3 years ago

I created it for my use case, since I don't use Hass.io... I looked into Hass.io addons, which seem to be using Docker as well, so it might be relatively easy to transform this into an addon... If you want to help with that, thats very much appreciated! I might also look into a better integration when I have the time.

MaxWinterstein commented 3 years ago

Sure thing, wrapping this should be relatively easy. The only problematic thing I see would be resolved by #2 - having some non-interactive setup.

I guess it could be either resolved by

I will see what I can do as nodejs is really not my main knowledgebase.

skank01 commented 3 years ago

+1 for an addon, would love to see that. Thanks guys! Nice work

davida72 commented 3 years ago

An addon would be awesome. I appreciate the efforts here!

MaxWinterstein commented 3 years ago

I created the first early alpha version of a eufy-ha-mqtt-bridge addon. Grep it at my add-on repository:

https://github.com/MaxWinterstein/homeassistant-addons

For easier debugging i symlinked the share folder to /app/data. So fetching logs is easy by using e.g. samba share: image

matijse commented 3 years ago

Cool! Thanks. As I do not use hass.io, I leave it to others to try it out...

davida72 commented 3 years ago

Great! Seems to have installed okay and I can get to config.yml via samba. I'll configure it when I get some spare time.

MaxWinterstein commented 3 years ago

Great! Seems to have installed okay and I can get to config.yml via samba. I'll configure it when I get some spare time.

No, do not edit the config.yml via samba. It is re-generated on every start of the add-on. Only edit via the Configuration-Tab.

davida72 commented 3 years ago

No, do not edit the config.yml via samba. It is re-generated on every start of the add-on. Only edit via the Configuration-Tab.

I'm sorry. Where within the 'Configuration' tab?

Edit: in case it's relevant I have EufyCam 2C cameras which I know have yet to be tested.

Edit2: I've just noticed my integration is broken as per this issue so I'll take another look when that's resolved.

skank01 commented 3 years ago

I'm gonna try asap. Is it build on latest version? Are we able to update through the addon stuff..

MaxWinterstein commented 3 years ago

No, do not edit the config.yml via samba. It is re-generated on every start of the add-on. Only edit via the Configuration-Tab.

I'm sorry. Where within the 'Configuration' tab?

Edit: in case it's relevant I have EufyCam 2C cameras which I know have yet to be tested.

Edit2: I've just noticed my integration is broken as per this issue so I'll take another look when that's resolved.

If you are using the add-on version, which I assume because of samba, it should be right here:

image


I'm gonna try asap. Is it build on latest version? Are we able to update through the addon stuff..

It pulls the most recent docker image, which seems to be build every time the master branch here is changed. Updating should be easily be possible via the REBUILD button:

image

davida72 commented 3 years ago

I was looking on the main Configuration section in Home Assistant and missed the Configuration tab on the Add On. Thanks for the screenshot.

Good news: everything seemed to work as expected, according to the log. Plus, I was notified of an available update. Perfect!

Bad news: My EufyCam 2C is not supported.

Good news: I believe I can provide the relevant information to get it supported. I'll do that later.

So far so good.

davida72 commented 3 years ago

Here's an icon for the addon page, if you'd like it.

icon

skank01 commented 3 years ago

Here's an icon for the addon page, if you'd like it.

icon

Nice

MaxWinterstein commented 3 years ago

Here's an icon for the addon page, if you'd like it.

icon

Wow, this is awesome! <3 Was playing around with Gimb (sorry, no photoshop guy here) but no good idea was found.

My last try was this: image

But yours looks pretty nice to me. Will give it a try and see how it looks 👍

skank01 commented 3 years ago

I need a guest account for the addon to work right? Without 2FA?

davida72 commented 3 years ago

I need a guest account for the addon to work right? Without 2FA?

That's my understanding.

I use my.name+ha@gmail.com so that I don't have to deal with multiple mailboxes.

skank01 commented 3 years ago

Mm i made guest acount with gmail adres Then i logged out my app and tried to log in with that gmail adres but it says its invalid pasword.. do i truly need to download the app on other phone?

The guest account is invited..

skank01 commented 3 years ago

I started the addon but i get an error Add-on: Eufy Home Assistant MQTT Bridge Publish events as MQTT messages

Add-on version: 0.4.0 You are running the latest version of this add-on. parse error: Expected string key before ':' at line 1, column 4 [09:44:05] ERROR: Unknown HTTP error occured System: (aarch64 / raspberrypi4-64) Home Assistant Core: 2020.12.2 Home Assistant Supervisor: 2020.12.7

Please, share the above information when looking for help or support in, e.g., GitHub, forums or the Discord chat.

[cont-init.d] 00-banner.sh: exited 0. [cont-init.d] 01-log-level.sh: executing... [cont-init.d] 01-log-level.sh: exited 0. [cont-init.d] done. [services.d] starting services [services.d] done. Symlinking data dir removed '/app/data/.gitkeep' removed '/app/data/config.example.yml' removed directory '/app/data' exporting environment vars form options file patching console log level starting original stuff...

eufy-ha-mqtt-bridge@1.0.0 start /app NODE_ENV=production node --unhandled-rejections=strict index.js info: Migrating the database... {"timestamp":"2021-01-02T08:44:07.213Z"} (node:340) UnhandledPromiseRejectionWarning: TypeError: devices is not iterable at EufyHttp.refreshDevices (/app/eufy/http.js:14:24) at processTicksAndRejections (internal/process/task_queues.js:93:5) at async EufyClient.init (/app/eufy/client.js:13:5) (Use node --trace-warnings ... to show where the warning was created) (node:340) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! eufy-ha-mqtt-bridge@1.0.0 start: NODE_ENV=production node --unhandled-rejections=strict index.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the eufy-ha-mqtt-bridge@1.0.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2021-01-02T08_44_09_081Z-debug.log [cmd] /run.sh exited 1 [cont-finish.d] executing container finish scripts... [cont-finish.d] 99-message.sh: executing...

Oops! Something went wrong.

We are so sorry, but something went terribly wrong when starting or running this add-on.

Be sure to check the log above, line by line, for hints.

skank01 commented 3 years ago

ok got it working, sorry mate, this wasnt addon or this integration based issue.

r77s commented 3 years ago

Is this line a error?

[09:44:05] ERROR: Unknown HTTP error occured

Or can I ignore it?

skank01 commented 3 years ago

You can ignore that I had it too but all worked Now with latest version, that line is gone

davida72 commented 3 years ago

Just to say that this works perfectly for me. Thank you @MaxWinterstein!

I noticed that the Eufy was a bit washed out in the icon so here's a slightly modified one, if you want it.

logo

MaxWinterstein commented 3 years ago

Just to say that this works perfectly for me. Thank you @MaxWinterstein!

I noticed that the Eufy was a bit washed out in the icon so here's a slightly modified one, if you want it.

logo

Thx, will replace it 👍

image

1h8fulkat commented 3 years ago

ok got it working, sorry mate, this wasnt addon or this integration based issue.

@skank01 What was the issue for you? I'm running into the exact same error.

skank01 commented 3 years ago

I think this may be closed since now we have an addon?

davida72 commented 3 years ago

@MaxWinterstein any plans to put this in an official Add On repo?

MaxWinterstein commented 3 years ago

@MaxWinterstein any plans to put this in an official Add On repo?

Don't think so.

image


I think this may be closed since now we have an addon?

Not sure. Add-on needs some more love, like versioning.

davida72 commented 3 years ago

Fair enough!