Giter Site home page Giter Site logo

ha-addon's Introduction

Source Code Link

Home-Assistant-AddOn

ADD-ON:

DOCKER:

  • Use host network to discover and control DIY and LAN devices.
  • Currently, port forwarding is not supported, please make sure that port 3000 is idle.
  1. git clone https://github.com/CoolKit-Technologies/ha-addon.git
  2. cd ha-addon/eWeLink_Smart_Home/
  3. docker build . -t ewelink_smart_home
  4. Run the code below. Replace yourHomeAssistantUrl with your current Home Assisant URL.
docker run -d \
    --restart=unless-stopped \
    --network host \
    -e HA_URL=yourHomeAssistantUrl \
    -e SUPERVISOR_TOKEN=yourHomeAssitantLongLivedAccessToken \
    -v ./volume:/data \
    --name ewelink_smart_home \
    ewelink_smart_home
  • Example:
  docker run -d \
  --restart=unless-stopped \
  --network host \
  -e HA_URL=http://192.168.1.100:8123 \
  -e SUPERVISOR_TOKEN=eyJ~iJ9.eyJ~jF9.CkQ~Lho \
  -v ./volume:/data \
  --name ewelink_smart_home \
  ewelink_smart_home
  1. Access port 3000.

ha-addon's People

Contributors

coolkit-tony avatar irus avatar kenny59 avatar niezw avatar vforslund avatar zjia1231 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ha-addon's Issues

Entities are missing unique ID

Devices are missing Uniquie ID, so they cannot be modified in any way in home assistant - name, location, type, etc. This results in all devices from ewelink shown as one big switch in the dashboard, which cannot be assigned to any room.

Error shown when trying to edit entities in settings:
image

All devices dispalyed as one in the dashboard:
image

Cannot read attributes from Sonoff WiFi Bulb B02-B

I have Sonoff WiFi bulb B02-B integrated into HA with this eWeLink Smart Home Add-on.It was easy to setup and basics are working fine.
Now when I want to build some automation (read brightness value and change it) with this bulb I am not able to read brightness attribute.
In Developing tools I can see the entity related to this bulb (it is light.10010aaa88) and when I put the following into templating tool (from Developer tools):

Sonoff bulb {{ states.light.10010aaa88 }}

I am getting the following message:

TemplateSyntaxError: expected token 'end of print statement', got 'aaa88'

Other lights have no problems reading attributes.
Is there anything wrong with my setup ?

Open/Close Door Sensor is miscategorized as 'lock'

Sonoff Contact sensor model DW2-Wi-Fi is miscategorized as 'lock' for device class, which is limiting and also wrong; it's a contact open/close sensor.

Found here: /eWeLink_Smart_Home/dist/controller/CloudDW2WiFiController.js - line 91

Error reported every time turning on/off switch. 每次打开/关闭开关都会报error

Hi,
I am using homeassistant to control my SA-025 (2 channels), and every time I click the switch in HA, it takes seconds to take action.
At the same time, some errors pop out in the log of addon.
I am using cloud mode because it seems this switch does not support LAN mode. But in the log it still tries to control the device locally, and try cloud mode after LAN mode timeout?
The error is pasted below.

我在用homeassistant控制SA-025 (2通道),每次在HA中点开关之后,要等几秒钟才能起作用。并且在addon的log里会报很多error。
我在用cloud模式,因为这个开关好像不支持LAN模式。但从log中看好像每次开关还是先去尝试LAN控制,等timeout之后才回去尝试cloud模式?
error已经贴在下面。

HA emit call_service event {
domain: 'switch',
service: 'turn_on',
service_data: { entity_id: 'switch.100124d668_2' }
}
HA emit call_service event {
domain: 'persistent_notification',
service: 'dismiss',
service_data: { notification_id: 'config_entry_discovery' }
}
控制局域网多通道设备出错 {
iv: 'YWJjZGVmMTYzMDMzMzkyNQ==',
deviceid: '100124d668',
selfApikey: 'cdd0cab7-2c9e-405d-b13e-7cdb6e96f318',
encrypt: true,
sequence: '1630333925977',
data: 'YMofpAYM45agzdlFaUaw82g02lPtKniceFuFLH2JAzSBjI9RSVRvaIHYzJYYhyoI'
}
(node:21) UnhandledPromiseRejectionWarning: Error: getaddrinfo EAI_AGAIN ewelink_100124d668.local
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:69:26)
(node:21) 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: 29)
receive CK-WS msg: type--> message
receive CK-WS msg:
{"error":0,"deviceid":"100124d668","apikey":"cdd0cab7-2c9e-405d-b13e-7cdb6e96f318","sequence":"1630333935991"}
Found Lan Multi-Switch
getDataSync: disabled.json -> 100124d668 no data
Found Lan Multi-Switch
getDataSync: disabled.json -> 100124d668 no data
Found Lan Multi-Switch
getDataSync: disabled.json -> 100124d668 no data
Found Lan Multi-Switch
getDataSync: disabled.json -> 100124d668 no data
Found Lan Multi-Switch
getDataSync: disabled.json -> 100124d668 no data
Found Lan Multi-Switch
getDataSync: disabled.json -> 100124d668 no data

4CHR3 "not supported currently" in configuration.

Hi, I have a brand new Home Assistant install running, and I have installed your add-on as per your instructions. The add-on finds all my devices on my network, but says "Device not currently supported" under all of them.
They are a mix of 6x 4CHR3 and 3x BasicRFR3, all of which should be supported as stated in your guide. If I login with my Ewelink credentials, they show up and can be controlled, but only through the HA dashboard, not through the iOS Home app.
After a few minutes all devices disappears in the Home app, and your add-on config page comes with an error: "Get-device list failed".

All my Sonoff devices have the latest firmware, and work fine through the Ewelink app, and all of them has LAN control enabled.

Unable to find referenced entities switch.*

Hi there,

I am using 1.2.3 version and have added Sonof Mini.
When I try to switch it on/off from HA, this is what I got in logs and the switch doesn't react.
Please help

Logger: homeassistant.helpers.service
Source: helpers/service.py:129
First occurred: 9:06:44 PM (3 occurrences)
Last logged: 9:07:04 PM

Unable to find referenced entities switch.xxxxxxxxxxx

Sign In Issues & Not Working

When I sign in it goes me an sign in error but actually signs in because the Sign in goes away and it shows my switch

Dual R3 motor mode not appear on entities list

I want to control a blind with a Sonoff Dual R3. When you set up it using eWeLink app, you can choose switch, motor or meter. If you select motor, it won't appear on Home Assistant entities list. I have added the templates on configuration.yaml as it says on readme. If anyone knows how to fix this please tell me.

Device is on my mobile app and HA eWeLink tab, but not avalable in Lovelace

I have one (1) device - Pool Pump - that is on my mobile app (eWeLink) and it is shown in the EweLink Smart Home tab in HA, but on the Lovelace tab, it is shown as "Entity not available: 10007908a0.
I do also not see it listed under with the other SonOff devices under the "Development Tools" tab in HA.

Any idea where i can see why it is not shown?

image
image

Consumption on Energy panel

Dear Support,

May I ask you that will be available sonoff consumption (I have 3 POW R2) on integrated energy panel in HA?

Thank you in advance.

Cannot set HOME location

Logged into the addon successfully but it shows the default/first home and the devices gives an error "Device is not under your account".

Is there any way to change the home in a multi-home configuration?

Sensor are not updating

Door sensor DW2, don't update the state, it just update when I manually click to update ico
Screenshot_1
n at webinterface

Switch.Toggle service isn't working on Ewelink switches even from HA

If I test my Ewelink switches from the HA Developer tools/Services, they are not working with switch.toggle.
Services switch.turn_on and switch.turn_off are working however. Other (non-ewelink) switches are working with switch.toggle as well as from the app and from the watch, too.

I was about to use apps on my WearOS watch. Ewelink switches did nothing from the official wearos app (beta) so I had opened issue1954 there and slowly it became clear that it is caused by the addon. It wasn't working from the Home Slide app either (it's an unofficial HA client).

Tested versions:
Ewelink Addon 1.2.3
Home Assistant OS 7.0.rc1
Home Assistant Android client beta-1744-9fd3164-full

Version 1.0.0?

The installation is with version 1.0.0 and not 2.3.0 beta, why?

Login to HA when running addon as docker container

Related: #30

I'm using the current version from master branch.

After entering HA login/password, I redirected back to 192.168.1.x:3000 and see toast: "Get device list failed"

In HA I see the following message in logs:

image

Server logs:

Could not connect to HA-WS, please restart addon
HA-WS heartBeat: -1
Could not connect to HA-WS, please restart addon
HA-WS heartBeat: -1
Could not connect to HA-WS, please restart addon
HA-WS heartBeat: -1
Could not connect to HA-WS, please restart addon
HA-WS heartBeat: -1
Could not connect to HA-WS, please restart addon
HA-WS heartBeat: -1
getDataSync: user.json ->  no data
getDataSync: user.json ->  no data
Could not connect to HA-WS, please restart addon
HA-WS heartBeat: -1
getDataSync: user.json ->  no data
getDataSync: user.json ->  no data
getDataSync: user.json ->  no data
getDataSync: user.json ->  no data
Could not connect to HA-WS, please restart addon
HA-WS heartBeat: -1

ha-addon: v1.2.3
Home Assistant 2021.10.6

Error installing version 1.2.2

When trying to update or fresh install version 1.2.2, I'm getting the following error:
The command '/bin/sh -c yarn --production' returned a non-zero code: 1

I'm running Home Assistant SO in a raspberry pi 3

Ewelink Addon not showing in Add-on Store

After adding the URL "https://github.com/CoolKit-Technologies/ha-addon" in the repository, logs show it is added with no error but it doesn't show up in the add-on store!

Logs:
21-11-26 00:46:44 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/CoolKit-Technologies/ha-addon repository
21-11-26 00:46:44 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/home-assistant/addons repository
21-11-26 00:46:44 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/hassio-addons/repository repository
21-11-26 00:46:46 INFO (MainThread) [supervisor.store] Loading add-ons from store: 63 all - 0 new - 0 remove
21-11-26 00:46:46 INFO (MainThread) [supervisor.store] Loading add-ons from store: 63 all - 0 new - 0 remove

DW-2-Wi-fi don't show the change of state on HA

I installed the add-on and all my sonoff devices worked well, except my DW-2-Wi-fi sensor.
Right after I synchronized it (with my Eyelink account) it worked well. However, when I stay some hours without open/close my door, HA can't see the change of state anymore.
But it still works on Ewelink app (it changes the state normally there). So, I think the problem is on the add-on.
Can you help me?

Some devices shown as not LAN mode

For some reason one of my devices shown as not LAN in HA plugin but in mobile eWeLink app it shows correct. (please see screenshots). So it causes status delay or commands delay.

HA core-2021.10.5 (and earlier)
eWeLink Smart Home plugin version: 1.2.3 (and earlier)

Is it possible to configure plugin to use LAN connection instead of cloud?

Screenshot 2021-10-19 204416
Screenshot_20211019-204258
Screenshot_20211019-205618

Unable to enter Long Access Token in Addon config

I have installed the addon, and created a Long Access Token for it, but when I go to the 'Configuration' tab, I do not have the options section displayed, and there is no fields available for the Long Access Token. I access Home Assistant via Duckdns. Any thoughts, as currently I have to log in several times a day to keep the connection alive. Thanks.

Error on Instalation HA Addon

I can't install the addon in Home Assistant Supervised, core-2021.7.2 version.

Error log:

21-07-18 13:34:30 ERROR (SyncWorker_0) [supervisor.docker.addon] Can't build f4f71350/amd64-addon-ewelink_smart_home_slug:1.0.0: The command '/bin/sh -c yarn --production' returned a non-zero code: 1
21-07-18 13:34:30 ERROR (SyncWorker_0) [supervisor.docker.addon] Build log: 
Step 1/14 : FROM node:14-slim
 ---> 5b5334a1033b
Step 2/14 : RUN mkdir -p /workspace/node_modules
 ---> Running in e2b24e15daf6
Removing intermediate container e2b24e15daf6
 ---> c51cee53e8d8
Step 3/14 : COPY ["./dist", "./package.json", "/workspace/"]
 ---> 94dfc62728bd
Step 4/14 : WORKDIR /workspace
 ---> Running in ea8ebe207ec6
Removing intermediate container ea8ebe207ec6
 ---> 24bff83095d1
Step 5/14 : RUN yarn --production
 ---> Running in 63b837c85e5c
yarn install v1.22.5
info No lockfile found.
[1/4] Resolving packages...
error Couldn't find package "[email protected]" required by "[email protected]" on the "npm" registry.

info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Error: Couldn't find package "[email protected]" required by "[email protected]" on the "npm" registry.
    at MessageError.ExtendableBuiltin (/opt/yarn-v1.22.5/lib/cli.js:721:66)
    at new MessageError (/opt/yarn-v1.22.5/lib/cli.js:750:123)
    at PackageRequest.<anonymous> (/opt/yarn-v1.22.5/lib/cli.js:36539:17)
    at Generator.throw (<anonymous>)
    at step (/opt/yarn-v1.22.5/lib/cli.js:310:30)
    at /opt/yarn-v1.22.5/lib/cli.js:323:13
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

Removing intermediate container 63b837c85e5c

Strange supervisor logs related to add-on

I'm noticing these strange logs during the startup of the add-on. Anything I need to be concerned about?

21-12-21 21:26:01 INFO (SyncWorker_0) [supervisor.docker.addon] Starting Docker add-on f4f71350/amd64-addon-ewelink_smart_home_slug with version 1.2.3
21-12-21 21:26:02 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request initialize
21-12-21 21:26:02 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request initialize
21-12-21 21:26:02 INFO (MainThread) [supervisor.api.proxy] WebSocket access from f4f71350_ewelink_smart_home_slug
21-12-21 21:26:02 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request running
21-12-21 21:26:31 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-264788' coro=<WebSocketWriter.ping() done, defined at /usr/local/lib/python3.9/site-packages/aiohttp/http_websocket.py:672> exception=ConnectionResetError('Cannot write to closing transport')>
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/http_websocket.py", line 676, in ping
    await self._send_frame(message, WSMsgType.PING)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/http_websocket.py", line 653, in _send_frame
    self._write(header + message)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/http_websocket.py", line 663, in _write
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport

No source?

You mentioned this was open source and the “source” was on GitHub. All I can see are built files in the dist directory here. Can you please add the actual source.

Switches stop responding from home assistant after a couple of hours

The switches stop responding from home assistant after a couple of hours. Also automations stop working too and the core logs give me these errors:
WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities switch.a4800210d1
even when the switches still work.
I'm on 1.2.3
The problem is only temporarily resolved after a host reboot.

WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities switch.10007bac41_1

Every time I turn a switch on/off outside of the addon web interface, either through the HA panel or through Node-Red, this warning shows up in the HA log and this error shows up in the addon log

{"error":0,"deviceid":"10007bac41","apikey":"xxxxxxx-xxxxx-xxxxxxx-xxxx-xxxxxxxxxx","sequence":"1627681417168"} (node:21) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'outlet' of undefined at CloudMultiChannelSwitchController.<anonymous> (/workspace/controller/CloudMultiChannelSwitchController.js:108:47) at step (/workspace/controller/CloudMultiChannelSwitchController.js:46:23) at Object.next (/workspace/controller/CloudMultiChannelSwitchController.js:27:53) at /workspace/controller/CloudMultiChannelSwitchController.js:21:71 at new Promise (<anonymous>) at __awaiter (/workspace/controller/CloudMultiChannelSwitchController.js:17:12) at CloudMultiChannelSwitchController.updateState (/workspace/controller/CloudMultiChannelSwitchController.js:101:12) at CloudMultiChannelSwitchController.<anonymous> (/workspace/controller/CloudMultiChannelSwitchController.js:89:30) at step (/workspace/controller/CloudMultiChannelSwitchController.js:46:23) at Object.next (/workspace/controller/CloudMultiChannelSwitchController.js:27:53) (node:21) 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: 32376) receive CK-WS msg: type--> message receive CK-WS msg: pong WS:接收到心跳信息 pong

The switch does turn on/off though, the problem is that its filling up the logs and disk space.
This happens with every 4CH R3 device with latest ewelink firmware.

thanks

Not able to rename entities

I cannot rename the entities created at home assistant by this addon

Rename the entities is necessary when you have a large number of devices, specially when use the node red for create the automations. Node red only accept the entities names

Dual R3 shutters are not supported

Hi
Dual r3 shutters mode controllers dont appear in the home assistant dashboard.
under ewelink plugin, dual r3 appears as 2 entities with "reload" icon, which doesn't work.

atribute current_position is not updated when stoping when reaching the maximum

When I have the cover at around 50%, and I request to completely open them, the attribute current_position is not actualized with 0 (when they reach the maximum), it remains the previous value of 50 (if was previous at 50%)

See below the values of the attributes (note that my covers are physically completely opened, and in the app it also shows open, however in HA, the attribute shows 50)

restored: false
supported_features: 15
friendly_name: Living-RoomRollers
current_position: 50
state: 'on'

Please note that when we pause the status of the current_position will be correctly updated, this problem only happens when the covers stop by themselves (when they reach the maximum)

Sonoff USB Micro freezes in ha-addon

I have two Sonoff USB Micro and more other Sonoff devices.

About once per week, all Sonoff USB Micro devices stop to respond in Home Assistant. Clicking to their entities, the status changes for a second and then returns back. In the Addon UI, the device does not respond. All other devices (not Sonoff USB Micro) continue to work as expected. Sonoff USB Micro devices continue to work normally in the EWeLink Smart Home Android application.

Restart of the addon fixes the problem, but it re-appears again in several days.

Icons

Icons dont work on entities
Screenshot_2021-06-26-09-33-53-171_io homeassistant companion android

Docker mode not authenticated in HA

I’m running HA in docker and also this plugin in docker.
I could see in wonderful_liksov container when it’s trying to connect to HA with
HA-WS heartBeat ping but in HA logs communication is being denied .
Is there a way to get add on authenticated with HA?
Portainer  local 2
Portainer  local

iFan 03 light control

This is an issue that is not covered on the readme but I was able to solve it.

If you have an iFan03, the settings available on https://github.com/CoolKit-Technologies/ha-addon/blob/master/eWeLink_Smart_Home/README.md are missing one configuration so that you are able to control the light from the Lovelace dashboard.

Add this to configuration.yaml:

light:            
  - platform: template
    lights:
      ewelink_virtual_fan:
        turn_on:
          service: light.turn_on
        turn_off:
          service: light.turn_off

Without this configuration you get the error:
Failed to call service light/turn.on. Service not found

Hope that this helps someone so that they avoid the 3 days of troubleshooting that I performed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.