djerik / beolink-ha

Home Assistant component that acts as a bridge making your Home Assistant entities available in the BeoLink app
6 stars 0 forks source link

Still doesn't work. #2

Open hjs3372 opened 10 months ago

hjs3372 commented 10 months ago

I applied your update and tried again, but it didn't work. I removed the Trust Network Authenticator, switched to Home Assistant Authenticator, and tried again. This time the authentication passes but something is still wrong. What information would be helpful to you?

AB702D9B-43C0-4ED3-B5F8-A58270B4AC15_1_102_o 3DE5D2E0-114B-40AE-BB5E-34D3841AB09E_1_102_o

djerik commented 10 months ago

I am sorry for this.

Do you have any erros in Home Assistant logs?

What environment are you running HA from?

Are you getting a json response on this url http://ip//blgwpservices.json (replace ip with the ip of your Home Assistant host). Login is your Home Assistant credentials. Please also share the response.

Thirdly you can start a Telnet or similar and test that you can connect to port 9100 on the host of the HA server. It reply with "login:"

hjs3372 commented 10 months ago
  1. Environment I have Home Assistant running as a VM on proxmox. Core: 2023.11.3 Supervisor: 2023.11.6 Operating System: 11.1 Frontend: 20231030.2 The network is a single subnet that integrates wired and wireless.

  2. http://ip//blgwpservices.json Certification seems to be in progress. The answer is: 404: Not Found

  3. Telnet "login:" appears. I am willing to comply with any information requests.

djerik commented 10 months ago

I am no proxmox or network expert, but here is my input: Looks like http://ip/blgwpservices.json is the show stopper. Given that you get a 404, I expect you have something else running on port 80? Unfortunately, I have not been able to make the BeoLiving app use another port, so the only options I know:

hjs3372 commented 10 months ago

There is nothing else using port 80. When I set port 80 as shown in the picture and connect to http://HA_ip//blgwpservices.json, 404 appears in white letters on a black background as shown in the second picture.

Screenshot 2023-12-06 at 9 18 51 AM

In my real BLGW, the blgwpservices.json file is downloaded from the address http://BLGW_ip/blgwpservices.json. However, a 404 error still occurs at http://BLGW_ip//blgwpservices.json.

Screenshot 2023-12-06 at 9 20 40 AM

The backgrounds and fonts in the two cases are slightly different. I also approached my beosound moment. Screenshot 2023-12-06 at 9 16 59 AM

I'm not an expert, but I think the server is running and accessible. I believe there must be another cause somewhere.

djerik commented 10 months ago

I see a typo in my post. The URL should be with single "/" : http://ip/blgwpservices.json

If this url works, please share the result.

hjs3372 commented 10 months ago

When accessing the address http://ip/blgwpservices.json: When my auth_providers configuration uses Trusted Networks, a login window appears, but login is not possible, so the login window appears repeatedly. When I use homeassistant, login succeeds, but a 500 error occurs as follows.

500 Internal Server Error Server got itself in trouble

djerik commented 10 months ago

Do you have any exceptions in the server log?

Are you using special characters in any entities or rooms?

If feasible, you can also try and limit/reduce the number of entities available for HA by removing them from rooms. Using trial and error we would know which is causing the problem.

I will check why there is a difference between trusted network and HA authentication

hjs3372 commented 10 months ago
  1. There is nothing special about the log.

  2. Home Assistant supports two-byte characters in Area or Entity names. I have quite a few Area/Entitiy names that contain Korean. This could be considered a special character. Since Home Assistant does not allow 2-byte characters for Area/Entity IDs, can you modify it to use the ID instead of this name?

  3. If I could manually specify which entities are exposed as beolink, it would be useful to identify the problem. Is there a way?

djerik commented 9 months ago

I have been looking into this, and I would like to first focus on getting http://ip/blgwpservices.json to work from a browser.

Any exception in the beolink component should throw a readable exception. The 500 Internal Server Error "Server got itself in trouble" message, tells me it is an internal HA / Supervisor / hass.io exception. Google points me in direction of situations with problems using console authentication.

Regarding Trusted Network; if it is not configured correctly (wrong IP), the login window will appear again and again. This is a consequence of the way I have implemented the component, due to the low level of security of the beoliving app, so that it should only be used on local network. Hence if the Trusted Network fails, it requests login again. Are you sure it is configured correctly?

Currently there is no prioritization of login method in the beolink component, it just loops auth providers from HA, and try to see if it supports one of the configured. When you disable Trusted Network, only the standard HassAuthProvider are supported. Do you have any other special authentication configured? Maybe you can share your configuration.yaml?

hjs3372 commented 9 months ago

I configured beolink in HA a little while ago again. I think it's due to the recent HA update, but the previous problems are gone and I can now connect to the beoliving app for the first time. Now authentication and connection are successful, but it says "unavailable devices". As a result, the problem with trusted networks disappeared. However, there is a "500 Internal Server Error" issue. I posted as many pictures as I could. I hope this helps you.

스크린샷 2023-12-23 오후 11 31 44 스크린샷 2023-12-23 오후 11 31 19 스크린샷 2023-12-23 오후 11 36 39 스크린샷 2023-12-23 오후 11 43 55 스크린샷 2023-12-23 오후 11 32 56 스크린샷 2023-12-23 오후 11 41 30

djerik commented 9 months ago

I will try and replicate your settings.

What port are your HA using?

hjs3372 commented 9 months ago

I use all ports as default. HA is set to 8123 and beolink HA is set to 80. In addition, also use a few add-ons. 스크린샷 2023-12-24 오전 1 42 03

hjs3372 commented 9 months ago

I found these two logs a while ago. I didn't see it before.

========================================================== Logger: aiohttp.server Source: /usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py:421 First occurred: 12:01:27 AM (1 occurrences) Last logged: 12:01:27 AM

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request resp = await request_handler(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 543, in _handle resp = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 114, in impl return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp_basicauth/init.py", line 82, in call return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/beolink/blgwserver.py", line 211, in blgwpservices "Select source by id?"+source[1]["id"]


KeyError: 'id'

==========================================================
This error originated from a custom integration.

Logger: homeassistant
Source: custom_components/beolink/hipserver.py:165
Integration: BeoLink (documentation, issues)
First occurred: December 25, 2023 at 11:56:27 PM (1 occurrences)
Last logged: December 25, 2023 at 11:56:27 PM

Error doing job: Fatal error: protocol.data_received() call failed.
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 1003, in _read_ready__data_received
    self._protocol.data_received(data)
  File "/config/custom_components/beolink/hipserver.py", line 333, in data_received
    self.handle_resource_state_data(
  File "/config/custom_components/beolink/hipserver.py", line 217, in handle_resource_state_data
    state_updates = self.hip_ressources_by_entity_id[entity_id].state_updates(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/beolink/hipserver.py", line 165, in state_updates
    + str(round(attributes[ATTR_HS_COLOR][0]))
                ~~~~~~~~~~~~~~~~~~~~~~~~~^^^
TypeError: 'NoneType' object is not subscriptable
This error originated from a custom integration.

Logger: homeassistant
Source: custom_components/beolink/hipserver.py:165
Integration: BeoLink (documentation, issues)
First occurred: December 25, 2023 at 11:56:27 PM (1 occurrences)
Last logged: December 25, 2023 at 11:56:27 PM

Error doing job: Fatal error: protocol.data_received() call failed.
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/asyncio/selector_events.py", line 1003, in _read_ready__data_received
    self._protocol.data_received(data)
  File "/config/custom_components/beolink/hipserver.py", line 333, in data_received
    self.handle_resource_state_data(
  File "/config/custom_components/beolink/hipserver.py", line 217, in handle_resource_state_data
    state_updates = self.hip_ressources_by_entity_id[entity_id].state_updates(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/beolink/hipserver.py", line 165, in state_updates
    + str(round(attributes[ATTR_HS_COLOR][0]))
                ~~~~~~~~~~~~~~~~~~~~~~~~~^^^
TypeError: 'NoneType' object is not subscriptable
djerik commented 9 months ago

Thank you for the log output - very helpful.

I have improved the handling of beoplay devices - I hope you can now access the http://ip/blgwpservices.json from a browser.

hjs3372 commented 9 months ago

Unfortunately there was no improvement. I still get "500 Internal Server Error". But, I found something definite.

Every time I access blgwpservices.json, the following error log appears.

Logger: aiohttp.server Source: /usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py:421 First occurred: 오후 9:22:08 (1 occurrences) Last logged: 오후 9:22:08

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request resp = await request_handler(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 543, in _handle resp = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 114, in impl return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/aiohttp_basicauth/init.py", line 82, in call return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/beolink/blgwserver.py", line 194, in blgwpservices "name": entity.device_info["name"],


KeyError: 'name'

Take your time.
I have a lot of time.
djerik commented 9 months ago

It appears you have an alarm antity without a name. You can correct the name property or update again and the entity will be ignored until it has a name

hjs3372 commented 9 months ago

I deleted Integration, removed it from HACS, and reinstalled it. However, the reaction is the same.

What I found out is that when I restart HA and load blgwpservices.json before it completes completely, I get the following: However, when the HA restart is completely completed, a 500 Internal Server Error still appears.

Some of my entities still have no names or use 2-byte characters (Korean characters). There are so many of them and some cannot be changed because they are integrated from other platforms. (I already disabled 300 entities) However, there are still many things that cannot be changed or disabled. It has already gotten to the point where I have to change many things and modify numerous templates.

I would have to give up using Beolink if Korean characters were causing the problem.

스크린샷 2024-01-06 오후 10 54 48

djerik commented 9 months ago

Sorry for all the problems. I don't expect the main cause is two byte characters, but just different entities that my code doesn't handle. Please check your logs for errors again

hjs3372 commented 9 months ago

I disabled the alarm-related parts below and had some success. But I still can't log in to the beolink app. It stops at authorizing.

if state.domain == ALARM_DOMAIN:

alarm = {

"type": "ALARM",

"name": entity.device_info["name"],

"id": entity.entity_id,

"systemAddress": "HomeAssistant",

"hide": False,

"commands": ["ARM", "DISARM"],

"states": ["ALARM", "MODE", "READY"],

"events": [],

}

bl_ressources[area_id][state.entity_id] = alarm

{"timestamp": 1704557981, "port": 9100, "sn": 24699466, "project": "BLGW", "installer": {"name": "", "contact": ""}, "version": 2, "fwversion": "1.5.4.557", "units": {"temperature": "C"}, "macroEdition": true, "location": {"centerlat": 0, "centerlon": 0, "radius": 0, "handler": "Main/global/SYSTEM/BLGW"}, "areas": [{"name": "House", "zones": [{"name": "BathRoom", "icon": "house", "special": false, "forbidden": false, "resources": [{"type": "DIMMER", "name": "dawon_switch Bottom", "id": "light.bathroom_2", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}, {"type": "DIMMER", "name": "dawon_switch Center", "id": "light.bathroom_1", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}]}, {"name": "BedRoom", "icon": "house", "special": false, "forbidden": false, "resources": [{"type": "DIMMER", "name": "Bedroom Group Hue", "id": "light.cimsil", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}, {"type": "AV renderer", "name": "BeoVision11-46", "id": "media_player.beovision11_46", "systemAddress": "HomeAssistant", "hide": false, "commands": ["All standby", "Beo4 advanced command", "Beo4 command", "BeoRemote One Source Selection", "BeoRemote One command", "Channel selection", "Cinema mode", "Master volume adjust", "Master volume level", "Picture Mute", "Picture mode", "Playqueue add Deezer playlist", "Playqueue add TuneIn station", "Playqueue add URL", "Playqueue clean", "Recall profile", "Save profile", "Select channel", "Select source", "Select source by id", "Send command", "Send digit", "Sound mode", "Speaker group", "Stand position", "Standby", "Volume adjust", "Volume level"], "events": ["All standby", "Control", "Light"], "states": ["nowPlaying", "nowPlayingDetails", "online", "sourceName", "sourceUniqueId", "state", "volume"], "Beo4NavButton": true, "sn": "25002704", "sources": [], "playQueueCapabilities": "deezer,dlna", "integratedRole": "none", "integratedSN": ""}, {"type": "DIMMER", "name": "Light Strip", "id": "light.light_strip", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}, {"type": "DIMMER", "name": "Room1", "id": "light.room1", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}, {"type": "DIMMER", "name": "Room2", "id": "light.room2", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}, {"type": "DIMMER", "name": "Room3", "id": "light.room3", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}, {"type": "DIMMER", "name": "Room4", "id": "light.room4", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}, {"type": "THERMOSTAT_1SP", "name": "Smartmi Smart Convector Heater 1S", "id": "climate.zhimi_zb1_6a14_heater", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET SETPOINT", "SET MODE", "SET FAN AUTO"], "states": ["TEMPERATURE", "SETPOINT", "MODE", "FAN AUTO", "VALUE"], "events": ["STATE_UPDATE"]}, {"type": "DIMMER", "name": "shogun_bulb", "id": "light.sonoff_1001493c3b", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}]}, {"name": "DressRoom", "icon": "house", "special": false, "forbidden": false, "resources": [{"type": "DIMMER", "name": "Dressroom Group Hue", "id": "light.haenggeo", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}, {"type": "DIMMER", "name": "Hue white lamp 1", "id": "light.hue_white_lamp_1", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}, {"type": "DIMMER", "name": "Hue white lamp 2", "id": "light.hue_white_lamp_2", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}, {"type": "DIMMER", "name": "Hue white lamp 3", "id": "light.hue_white_lamp_3", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}, {"type": "DIMMER", "name": "Hue white lamp 4", "id": "light.hue_white_lamp_4", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}]}, {"name": "Kitchen", "icon": "house", "special": false, "forbidden": false, "resources": [{"type": "DIMMER", "name": "Kitchen Group Hue", "id": "light.jubang", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}, {"type": "SHADE", "name": "fan_cover", "id": "cover.fan_cover", "systemAddress": "HomeAssistant", "hide": false, "commands": ["LOWER", "RAISE", "STOP", "SET"], "states": ["LEVEL"], "events": []}, {"type": "DIMMER", "name": "kitchen1", "id": "light.hue_color_lamp_1_2", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}, {"type": "DIMMER", "name": "kitchen2", "id": "light.hue_color_lamp_2", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}, {"type": "DIMMER", "name": "kitchen3", "id": "light.hue_ambiance_lamp_1", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}]}, {"name": "LivingRoom", "icon": "house", "special": false, "forbidden": false, "resources": [{"type": "AV renderer", "name": "BeoLink Converter NL/ML", "id": "media_player.beolink_converter_nl_ml_2", "systemAddress": "HomeAssistant", "hide": false, "commands": ["All standby", "Beo4 advanced command", "Beo4 command", "BeoRemote One Source Selection", "BeoRemote One command", "Channel selection", "Cinema mode", "Master volume adjust", "Master volume level", "Picture Mute", "Picture mode", "Playqueue add Deezer playlist", "Playqueue add TuneIn station", "Playqueue add URL", "Playqueue clean", "Recall profile", "Save profile", "Select channel", "Select source", "Select source by id", "Send command", "Send digit", "Sound mode", "Speaker group", "Stand position", "Standby", "Volume adjust", "Volume level"], "events": ["All standby", "Control", "Light"], "states": ["nowPlaying", "nowPlayingDetails", "online", "sourceName", "sourceUniqueId", "state", "volume"], "Beo4NavButton": true, "sn": "24833156", "sources": [], "playQueueCapabilities": "deezer,dlna", "integratedRole": "none", "integratedSN": ""}, {"type": "AV renderer", "name": "BeoSound Moment", "id": "media_player.beosound_moment_25105167", "systemAddress": "HomeAssistant", "hide": false, "commands": ["All standby", "Beo4 advanced command", "Beo4 command", "BeoRemote One Source Selection", "BeoRemote One command", "Channel selection", "Cinema mode", "Master volume adjust", "Master volume level", "Picture Mute", "Picture mode", "Playqueue add Deezer playlist", "Playqueue add TuneIn station", "Playqueue add URL", "Playqueue clean", "Recall profile", "Save profile", "Select channel", "Select source", "Select source by id", "Send command", "Send digit", "Sound mode", "Speaker group", "Stand position", "Standby", "Volume adjust", "Volume level"], "events": ["All standby", "Control", "Light"], "states": ["nowPlaying", "nowPlayingDetails", "online", "sourceName", "sourceUniqueId", "state", "volume"], "Beo4NavButton": true, "sn": "25105167", "sources": [], "playQueueCapabilities": "deezer,dlna", "integratedRole": "none", "integratedSN": ""}, {"type": "AV renderer", "name": "BeoVision-Avant-55", "id": "media_player.beovision_avant_55", "systemAddress": "HomeAssistant", "hide": false, "commands": ["All standby", "Beo4 advanced command", "Beo4 command", "BeoRemote One Source Selection", "BeoRemote One command", "Channel selection", "Cinema mode", "Master volume adjust", "Master volume level", "Picture Mute", "Picture mode", "Playqueue add Deezer playlist", "Playqueue add TuneIn station", "Playqueue add URL", "Playqueue clean", "Recall profile", "Save profile", "Select channel", "Select source", "Select source by id", "Send command", "Send digit", "Sound mode", "Speaker group", "Stand position", "Standby", "Volume adjust", "Volume level"], "events": ["All standby", "Control", "Light"], "states": ["nowPlaying", "nowPlayingDetails", "online", "sourceName", "sourceUniqueId", "state", "volume"], "Beo4NavButton": true, "sn": "24403171", "sources": [], "playQueueCapabilities": "deezer,dlna", "integratedRole": "none", "integratedSN": ""}, {"type": "AV renderer", "name": "Beoplay M3", "id": "media_player.beoplay_m3", "systemAddress": "HomeAssistant", "hide": false, "commands": ["All standby", "Beo4 advanced command", "Beo4 command", "BeoRemote One Source Selection", "BeoRemote One command", "Channel selection", "Cinema mode", "Master volume adjust", "Master volume level", "Picture Mute", "Picture mode", "Playqueue add Deezer playlist", "Playqueue add TuneIn station", "Playqueue add URL", "Playqueue clean", "Recall profile", "Save profile", "Select channel", "Select source", "Select source by id", "Send command", "Send digit", "Sound mode", "Speaker group", "Stand position", "Standby", "Volume adjust", "Volume level"], "events": ["All standby", "Control", "Light"], "states": ["nowPlaying", "nowPlayingDetails", "online", "sourceName", "sourceUniqueId", "state", "volume"], "Beo4NavButton": true, "sn": "28752313", "sources": [], "playQueueCapabilities": "deezer,dlna", "integratedRole": "none", "integratedSN": ""}, {"type": "CAMERA", "name": "Front Door", "rtspSupport": false, "commands": []}, {"type": "DIMMER", "name": "Left1", "id": "light.left1", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}, {"type": "DIMMER", "name": "Left2", "id": "light.left2", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}, {"type": "DIMMER", "name": "Left3", "id": "light.left3", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}, {"type": "DIMMER", "name": "Left4", "id": "light.left4", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}, {"type": "SHADE", "name": "Linptech Intelligent Sliding Window Driver WD1 Window Opener", "id": "cover.linp_wd1lb_7848_window_opener", "systemAddress": "HomeAssistant", "hide": false, "commands": ["LOWER", "RAISE", "STOP", "SET"], "states": ["LEVEL"], "events": []}, {"type": "DIMMER", "name": "Right1", "id": "light.right1", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}, {"type": "DIMMER", "name": "Right2", "id": "light.right2", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}, {"type": "DIMMER", "name": "Right3", "id": "light.right3", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}, {"type": "DIMMER", "name": "Right4", "id": "light.right4", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}, {"type": "THERMOSTAT_1SP", "name": "Solid", "id": "climate.nest_thermostat", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET SETPOINT", "SET MODE", "SET FAN AUTO"], "states": ["TEMPERATURE", "SETPOINT", "MODE", "FAN AUTO", "VALUE"], "events": ["STATE_UPDATE"]}, {"type": "SHADE", "name": "WD Window Opener", "id": "cover.linp_wd1lb_fd7d_window_opener", "systemAddress": "HomeAssistant", "hide": false, "commands": ["LOWER", "RAISE", "STOP", "SET"], "states": ["LEVEL"], "events": []}, {"type": "DIMMER", "name": "livingroom_Hue", "id": "light.geosil", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}, {"type": "SHADE", "name": "zemismart zigbee curtain motor", "id": "cover.zemismart_zigbee_curtain_motor_curtain", "systemAddress": "HomeAssistant", "hide": false, "commands": ["LOWER", "RAISE", "STOP", "SET"], "states": ["LEVEL"], "events": []}]}, {"name": "MediaArea", "icon": "house", "special": false, "forbidden": false, "resources": [{"type": "DIMMER", "name": "Hue Play 1", "id": "light.hue_play_1", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}, {"type": "DIMMER", "name": "Hue Play 2", "id": "light.hue_play_2", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}, {"type": "DIMMER", "name": "TV", "id": "light.tv_2", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}, {"type": "DIMMER", "name": "TV Hue Scene", "id": "light.tv_hue_scene", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}]}, {"name": "MusicRoom", "icon": "house", "special": false, "forbidden": false, "resources": [{"type": "DIMMER", "name": "Music", "id": "light.eumag", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}, {"type": "DIMMER", "name": "Tolomeo", "id": "light.hue_color_lamp_1", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}]}]}, {"name": "Main", "zones": [{"name": "global", "icon": "house", "special": true, "forbidden": false, "resources": []}]}]}

djerik commented 9 months ago

That's good news! Your json looks correct, but I will validate it later by loading it into my server.

Have you checked to logs for errors?

hjs3372 commented 9 months ago

Now there are no more logs related.

djerik commented 9 months ago

I loaded your json and it is valid and the BeoLiving app displays it accordingly.

I suspect the hipserver (port 9100) to be next problem.

Are you sure there are no "beolink" og "hipserver" messages in logs?

PS: I recommend you restart the BeoLiving app after making changes in Home Assistant.

hjs3372 commented 8 months ago

The current status is as follows. There is another error message that is different from before.

{"timestamp": 1705063113, "port": 9100, "sn": 24699466, "project": "BLGW", "installer": {"name": "", "contact": ""}, "version": 2, "fwversion": "1.5.4.557", "units": {"temperature": "C"}, "macroEdition": true, "location": {"centerlat": 0, "centerlon": 0, "radius": 0, "handler": "Main/global/SYSTEM/BLGW"}, "areas": [{"name": "House", "zones": []}, {"name": "Main", "zones": [{"name": "global", "icon": "house", "special": true, "forbidden": false, "resources": []}]}]}
Logger: aiohttp.server
Source: /usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py:421
First occurred: PM 5:48:30 (59 occurrences)
Last logged: PM 9:35:53

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 350, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "aiohttp/_http_parser.pyx", line 557, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message:
  Invalid method encountered:

    b'\x16\x03\x01'
      ^
djerik commented 8 months ago

I have released a new major version with many fixes.

Please remove the old before installing and remember to configure what entities to include afterwards using the new config dialogue

hjs3372 commented 8 months ago

Something seems wrong. I deleted the existing one through HACS and reinstalled it. The integration cannot be installed.

스크린샷 2024-01-25 오전 11 09 41

Logger: homeassistant.config_entries Source: config_entries.py:2087 First occurred: 11:09:20 AM (1 occurrences) Last logged: 11:09:20 AM

Error occurred loading flow for integration beolink: No module named 'config.custom_components'

djerik commented 8 months ago

I fixed the wrong path. Took me forever to realize that the import path was wrong, but for some reason it worked on my dev machine.

Fingers crossed this works for you

hjs3372 commented 8 months ago

I took the time to test it. It's great to be able to specify entities in HA. http://ip/blgwpservices.json There is more content than before and appears immediately.

However, in my case, I cannot log in from either my iPhone, iPad, or M1 Mac Mini's iPad app. I tested it in both configurations with and without a trusted networks provider.

I feel a little sorry for always giving negative feedback.

djerik commented 8 months ago

Don't feel sorry about the feedback - it is the only way to for me to improve the component.

1) Have you checked to logs? 2) Have you tried to change settings to only include a simple light or shade? 3) I have improved the hip server, so that it can be used from telnet. You can try to:

I hope you can help me help you using the above. I am also happy to setup an online session where we can look into it together?

hjs3372 commented 8 months ago

There is feedback about telnet connection and "f". "q ///" : I don't know exactly what character this is. Are there three "/"?

djerik commented 8 months ago

I did not notice Github changed the display of the command.

The correct command is: q */*/*/*

It means Query any House/Room/Device/State and reply status

Full description of protocol is here: https://bangolufsenrmaskillgohel.blob.core.windows.net/zendesk-guide/B2B%20Toolbox/3rd%20Party%20integration%20Drivers%20and%20Protocols/BLGW_Home_Integration_Protocol.pdf

hjs3372 commented 8 months ago

It reacts as follows: After q */*/*/*, the state is displayed and automatically logged out.

root@ubuntu:~# telnet myip 9100
Trying myip...
Connected to myip.
Escape character is '^]'.
login: **********

password: ************

f
e OK f
q */*/*/*
e OK q%20%2A/%2A/%2A/%2A
s House/BathRoom/DIMMER/dawon_switch%20Center/STATE_UPDATE?LEVEL=0
s House/BathRoom/DIMMER/dawon_switch%20Bottom/STATE_UPDATE?LEVEL=0
s nowPlaying=&nowPlayingDetails=&online=Yes&sourceName=&sourceUniqueId=&state=&volume=0
Connection closed by foreign host.
root@ubuntu:~# 
djerik commented 8 months ago

My observations:

hjs3372 commented 8 months ago

I tried activating only 1 device and still can't log in in the beoliving app. As you know, I use a trusted network authentication provider. I always test this even after uninstalling it. When the trusted network authentication provider is enabled, I cannot even log in to the http://ip/blgwpservices.json page. If disabled, can log in at http:// /ip/blgwpservices.json. However, I cannot always log in to the beoliving app. I can't find any related logs either.

I can't enter a login when displaying the dashboard from certain IPs (but not all), so I have to use a trusted network authentication provider. Therefore, in fact, I cannot maintain a normal environment without activating the trusted network authentication provider.

I hope this will be possible one day when everything is working.

beolink log

2024-02-04 12:23:22.373 DEBUG (MainThread) [custom_components.beolink.hipserver] Received: myid
2024-02-04 12:23:22.395 DEBUG (MainThread) [custom_components.beolink.hipserver] Received: mypassword

Suspicious Log

2024-02-04 12:23:12.276 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 350, in data_received
messages, upgraded, tail = self._request_parser.feed_data(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "aiohttp/_http_parser.pyx", line 557, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: 400, message:
Invalid method encountered:
b'\x16\x03\x01'
^
djerik commented 8 months ago

I will have a look at the trusted network provider logic again.

hjs3372 commented 8 months ago

I tried again by adding only one hue light, but the connection drops right after q ///. And, there are logs.

Logger: homeassistant
Source: custom_components/beolink/hipserver.py:159
Integration: BeoLink ([documentation](https://github.com/djerik/beolink-ha), [issues](https://github.com/djerik/beolink-ha/issues))
First occurred: 오전 9:47:54 (3 occurrences)
Last logged: 오전 9:51:35

Error doing job: Fatal error: protocol.data_received() call failed.
Traceback (most recent call last):
  File "/config/custom_components/beolink/hipserver.py", line 149, in state_updates
    + str(round(attributes[ATTR_HS_COLOR][0]))
                ~~~~~~~~~~~~~~~~~~~~~~~~~^^^
TypeError: 'NoneType' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/asyncio/selector_events.py", line 1013, in _read_ready__data_received
    self._protocol.data_received(data)
  File "/config/custom_components/beolink/hipserver.py", line 338, in data_received
    self.handle_resource_state_data(
  File "/config/custom_components/beolink/hipserver.py", line 209, in handle_resource_state_data
    state_updates = self.hip_ressources_by_entity_id[entity_id].state_updates(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/beolink/hipserver.py", line 159, in state_updates
    _LOGGER.Exception( error_text)
    ^^^^^^^^^^^^^^^^^
AttributeError: 'HassLogger' object has no attribute 'Exception'. Did you mean: 'exception'?
djerik commented 8 months ago

I believe I have fixed the bug, so that BeoLink works with both dimmable, colored and not dimmable lights are supported

hjs3372 commented 7 months ago

blgwpservices.json and telnet are shown below. Telnet no longer disconnects automatically. However, it still doesn't connect through the Beoliving App.

{"timestamp": 1707982534, "port": 9100, "sn": 24746124, "project": "BLGW", "installer": {"name": "", "contact": ""}, "version": 2, "fwversion": "1.5.4.557", "units": {"temperature": "C"}, "macroEdition": true, "location": {"centerlat": 0, "centerlon": 0, "radius": 0, "handler": "Main/global/SYSTEM/BLGW"}, "areas": [{"name": "House", "zones": [{"name": "LivingRoom", "icon": "house", "special": false, "forbidden": false, "resources": [{"type": "DIMMER", "name": "Left1", "id": "light.left1", "systemAddress": "HomeAssistant", "hide": false, "commands": ["SET", "SET COLOR"], "states": ["LEVEL", "COLOR"]}]}]}, {"name": "Main", "zones": [{"name": "global", "icon": "house", "special": true, "forbidden": false, "resources": []}]}]}

q */*/*/*
e OK q%20%2A/%2A/%2A/%2A
djerik commented 7 months ago

1) Any errors in the log? 2) is your phone in the same network as HA and can reach both port 80 and 9100? 3) Are you logging in the HA user name and password? I have removed network/ip authenticating as it doesn't make sense from a UI perspective. 4) Don't you get a status from the Light in the telnet session? 5) Try activating Debug mode and share the log messages

vaughnlfisher commented 7 months ago

I can respond. I have the same error.

  1. image

  2. Phone and PC on same network

Attached is the telnet session. image

The app on my iPhone continues to just give the following message authorizing.

image

After pushing Login on the Iphone app the following is the only lines that appear in the HA logs. image

Thanks for your help Vaughn

djerik commented 7 months ago

Thank you for sharing.

Looking at the screenshot, I am wondering what device, app and app version is this? I can't seem to find the same screen on my BeoLiving app even when I join it with a B&O BLGW

vaughnlfisher commented 7 months ago

HiSee screenshot of BeoLiving app. It connects fine but is listed as unavailable?RegardsVaughnFisherOn 21 Feb 2024, at 00:21, Tobias Laursen @.***> wrote: Thank you for sharing. Looking at the screenshot, I am wondering what device, app and app version is this? I can't seem to find the same screen on my BeoLiving app even when I join it with a B&O BLGW

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

hjs3372 commented 7 months ago

I think it's the Beolink 2 app. I tested on both and the results were the same.

djerik commented 7 months ago

I will test later with the BeoLink app, but from your logs, I can see the command is different. It sends q //SYSTEM/* to HA which the component does not responds to, and hence the app is still waiting for a critical response. If I can reproduce from BeoLink 2 app, I will add support for this command. Can you try from BeoLiving app with debug active and post your logs?

vaughnlfisher commented 7 months ago

Hi

I am getting this now!

[image: image.png]

On Wed, Feb 21, 2024 at 9:17 AM Tobias Laursen @.***> wrote:

I will test later with the BeoLink app, but from your logs, I can see the command is different. It sends a ``` q //SYSTEM/*

— Reply to this email directly, view it on GitHub https://github.com/djerik/beolink-ha/issues/2#issuecomment-1956208929, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK6AAAMYPLTVFE5CXF4NKFDYUW3SRAVCNFSM6AAAAABAEPOQKKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJWGIYDQOJSHE . You are receiving this because you commented.Message ID: @.***>

djerik commented 7 months ago

I think a image got lost?

vaughnlfisher commented 7 months ago

Sorry! image

djerik commented 7 months ago

I fixed the thermostat bug and added support for BeoLink 2 app in latest release (1.0.4)

Fingers crossed this is the last showstopper :)

hjs3372 commented 7 months ago

I have some good news for the first time in a while. It works in beolink2 app due to your last update. Strange, but it works in beolink2 app and still not working in beoliving app.

I've tested quite a few devices on the beolink2 app and haven't found any issues.

peterkoe-GitHub commented 1 month ago

Hi @djerik, I would love to use the bridge with my B&O setup, but it dos not work. Are your still working on the integration ? Thanks!

djerik commented 1 month ago

Hi @peterkoe-GitHub

Yes I still actively maintain it, but I am dependent on bug reports or suggestions for improving it further.