binarylogic / trinnov-altitude-homeassistant

Trinnov Altitude integration for Home Assistant
Apache License 2.0
3 stars 2 forks source link

Unkown error occured adding host #3

Closed aoaaron closed 5 months ago

aoaaron commented 5 months ago

Hi, tried to add host 192.168.0.82 (left mac blank) and get 'unknown error occured'. wont proceed. forward. tried adding MAC address too but the same error.

binarylogic commented 5 months ago
  1. Did you install as a custom repository like I noted in #1?
  2. Can you provide me with the logs? You should be able to get them via the SSH add-on and tailing the homeassistant.log

I'm curious what the problem is because I've installed this integration ~100 times in the past week without issue.

aoaaron commented 5 months ago

just tried mac address too and it says its invalid.

192.1XX.0.X2 X8:bf:bX:XX:c6:ed

put X to anonymise numbers but ive put it in like this. trinnov accessible via web interface with the same ip/host address

aoaaron commented 5 months ago

2024-04-14 18:06:35.850 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration trinnov_altitude which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-04-14 18:06:35.850 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration lightener which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-04-14 18:06:35.850 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-04-14 18:06:36.848 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' accesses hass.components.frontend. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to import functions used from frontend directly at custom_components/hacs/frontend.py, line 68: hass.components.frontend.async_register_built_in_panel(, please create a bug report at https://github.com/hacs/integration/issues 2024-04-14 18:06:37.640 WARNING (MainThread) [slixmpp.stringprep] Using slower stringprep, consider compiling the faster cython/libidn one. 2024-04-14 18:12:25.200 ERROR (MainThread) [aiohttp.server] Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request resp = await request_handler(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle resp = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 88, in ban_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware response = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle result = await handler(request, request.match_info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 71, in with_admin return await func(self, request, *args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 222, in post return await super().post(request, flow_id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 73, in wrapper result = await method(view, request, data, args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 122, in post result = await self._flow_mgr.async_configure(flow_id, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 356, in async_configure result = await self._async_configure(flow_id, user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 402, in _async_configure result = await self._async_handle_step( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 506, in _async_handle_step result: _FlowResultT = await getattr(flow, method)(user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/trinnov_altitude/config_flow.py", line 45, in async_step_user mac = user_input[CONF_MAC].strip()


KeyError: 'mac'
aoaaron commented 5 months ago

Installed via the repo :)

binarylogic commented 5 months ago

Ah, I see. Thanks for the logs. Let me handle that error. I was not aware Home Assistant would strip blank keys.

aoaaron commented 5 months ago

Thank you mate. Really look forward to the integration. Trinnov is amazing. I can't be without it! :) This would be pivotal to my setup.

Any chance you can make a volume slider/remote/front-end similar to the normal app? Would be amazing to be able to toggle preset + volume and codec and input on the go from one place.

binarylogic commented 5 months ago

I released v1.1.6, can you try updating? Go into the Trinnov Altitude integration in HACs and "Redownload". You should be able to update to v1.1.6. HACs will also check for updates and notify you via settings. Either way works.

Screenshot 2024-04-14 at 10 47 25 AM
aoaaron commented 5 months ago

Thanks mate. Mac address still won't work. Says its invalid. Ip address now works. However when its installed, it states 'failed to setup'. It states 'no devices or entities' as the error.

aoaaron commented 5 months ago

2024-04-14 18:57:08.952 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration trinnov_altitude which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-04-14 18:57:08.952 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration lightener which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-04-14 18:57:08.952 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-04-14 18:57:10.392 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' accesses hass.components.frontend. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to import functions used from frontend directly at custom_components/hacs/frontend.py, line 68: hass.components.frontend.async_register_built_in_panel(, please create a bug report at https://github.com/hacs/integration/issues 2024-04-14 18:57:10.772 WARNING (MainThread) [slixmpp.stringprep] Using slower stringprep, consider compiling the faster cython/libidn one. 2024-04-14 18:58:24.063 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Trinnov Altitude (14682862) for trinnov_altitude Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 551, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/trinnov_altitude/init.py", line 20, in async_setup_entry mac = entry.data[CONF_MAC].strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'strip'

binarylogic commented 5 months ago

Bleh, I released a new version. Try v1.1.7. I'm curious why you don't want to supply the Mac address? I was considering making that required, but it's unconventional for Home Assistant. Otherwise, you must power on the Altitude separately, or leave it on, before you can use this integration.

aoaaron commented 5 months ago

Thanks mate will give it a try. I'm happy to give mac address. The integration says its incorrect everytime I put it in which is why I was skipping it. It keeps saying its incorrect.

aoaaron commented 5 months ago

117 still says mac address invalid. no idea why seems correct to me.

aoaaron commented 5 months ago

Remote coming up now with buttons and commands :) The mac address it still states its invalid for some strange reason so no power on/off capability.

binarylogic commented 5 months ago

Any chance you can make a volume slider/remote/front-end similar to the normal app? Would be amazing to be able to toggle preset + volume and codec and input on the go from one place.

This is present in the media player component that comes with the integration:

Screenshot 2024-04-14 at 11 28 59 AM

I added the ability for source selection here, but it's not working. I haven't had time to dig into it. Media players also have the ability to select a sound mode, which would allow switching between decoders or presets. That would be a good contribution.

Lastly, one thing that helped me with Home Assistant is to view it less as a physical remote control and more of an automation hub. This is why Home Assistant integrations don't come with pre-loaded remotes like you would normally expect. Instead, they're abstract, allowing you to use the send_command feature in automations, etc.

With my system I have everything automated based on source triggers. For example, if the Apple TV turns on, then it turns on the Trinnov Altitude, sets the appropriate source, resets the volume, selects the preset, etc. You can see how I did that here:

https://github.com/binarylogic/trinnov-altitude-homeassistant?tab=readme-ov-file#automations

binarylogic commented 5 months ago

The Mac address must start with c8:7f:54 or 64:98:9e. Can you confirm? If it does not, I can remove that restriction, but those are the Trinnov OUIs.

aoaaron commented 5 months ago

Mine starts with 08:bf:b8

Btw, is there any plans or scope for a remote control? and allowance to toggle preset & codec? at present it shows sensor data for which codec/preset is on but no easy way to toggle them :)

aoaaron commented 5 months ago

Thank you. Any chance for the remote you can add a input selector? As i believe that ability is in the code? :) That would be a massive upgrade.

I'm nnot sure how but it would be good if we could limit how fast the volume increases. i imagine that slider otherwise could do very dangerous if someone quickly swipes up!

binarylogic commented 5 months ago

Mine starts with 08:bf:b8

Strange, ok, I will remove the MAC address validation against OUIs.

Any chance for the remote you can add a input selector? As i believe that ability is in the code? :) That would be a massive upgrade.

I did add this, but it's not working for some reason. Frankly, the HA docs and code are very bad. But you can see what I did here:

https://github.com/binarylogic/trinnov-altitude-homeassistant/blob/16322cbcdc7f0a895a45cfb02b7ee075bf6e1268/custom_components/trinnov_altitude/media_player.py#L45

And here:

https://github.com/binarylogic/trinnov-altitude-homeassistant/blob/16322cbcdc7f0a895a45cfb02b7ee075bf6e1268/custom_components/trinnov_altitude/media_player.py#L87-L95

I'll look into why this is not working.

binarylogic commented 5 months ago

I'm nnot sure how but it would be good if we could limit how fast the volume increases. i imagine that slider otherwise could do very dangerous if someone quickly swipes up!

Yes, I would do this in Trinnov itself. You can set a maximum volume. That's what I did.

binarylogic commented 5 months ago

Closing since the issue is fixed. I just released v1.1.9 which will allow you to add a MAC address now.