core icon indicating copy to clipboard operation
core copied to clipboard

frontier_silicon integration not working using UI

Open jwaes opened this issue 1 year ago • 8 comments

The problem

After an upgrade of core i got a notification to remove the yaml code of the frontier_silicon integration as it is deprecated. Removed the yaml, now the device is not found via UI.

What version of Home Assistant Core has the issue?

core-2023.5.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

frontier_silicon

Link to integration documentation on our website

https://www.home-assistant.io/integrations/frontier_silicon/

Diagnostics information

Integration does not have diagnostic data.

Below is the removed yaml code, for which it worked.

After removing the yaml, and restarting HA, frontier_silicon reported to have found a device. But while the integration is added, no device shows up:

image

Example YAML snippet

media_player:
  - platform: frontier_silicon
    name: stereo
    host: 192.168.1.193

Anything in the logs that might be useful for us?

No response

Additional information

No response

jwaes avatar May 19 '23 11:05 jwaes

Hey there @wlcrs, mind taking a look at this issue as it has been labeled with an integration (frontier_silicon) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of frontier_silicon can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign frontier_silicon Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


frontier_silicon documentation frontier_silicon source (message by IssueLinks)

home-assistant[bot] avatar May 19 '23 11:05 home-assistant[bot]

Additional:

It does show up in the dev tools: image

But the UI link gives this error: image

This entity ('media_player.dit2005m_002261861068') does not have a unique ID, therefore its settings cannot be managed from the UI. See the [documentation](https://www.home-assistant.io/faq/unique_id) for more detail.

Which is kind of strange as ... i did NOT configure it using yaml ?

Hmmm. It might have to do with a conflict with the dlna_dmr integration https://www.home-assistant.io/integrations/dlna_dmr/

This Internet radio device triggers both integrations, and use the same device id ..

jwaes avatar May 19 '23 11:05 jwaes

I can confirm this behaviour, except from the double id error. I did not use this integration in the past. I can install it, but now devices show up. It can be found in the development tools showing all kinds of actual information. Using an +/-6 year old Medion device by the way.

steenderen avatar May 21 '23 16:05 steenderen

I'm suspecting the issue has to do with the current way the integration tries to derive an 'unique id'.

@all Can you please post the output of the following URL's (where you adapt the IP and pin):

http://192.168.1.183/fsapi/GET/netRemote.sys.info.radioId?pin=1234 http://192.168.1.183/fsapi/GET/netRemote.sys.net.wlan.macAddress?pin=1234 http://192.168.1.183/fsapi/GET/netRemote.sys.net.wired.macAddress?pin=1234 http://192.168.1.183/fsapi/GET_MULTIPLE?pin=1234&node=netRemote.sys.net.wired.macAddress&node=netRemote.sys.net.wlan.macAddress&node=netRemote.sys.info.radioId

Feel free to (partly) censor the responses. I'm mainly interested in whether they result in errors or valid responses.

wlcrs avatar May 23 '23 06:05 wlcrs

No problem. Here are the outputs (URL 4 is giving an error).

URL 1:

<fsapiResponse>
<status>FS_OK</status>
<value>
<c8_array>002261349B70</c8_array>
</value>
</fsapiResponse>

URL 2:

<fsapiResponse>
<status>FS_OK</status>
<value>
<c8_array>00:22:61:34:9b:70</c8_array>
</value>
</fsapiResponse>

URL 3:

<fsapiResponse>
<status>FS_OK</status>
<value>
<c8_array>00:22:61:34:9b:71</c8_array>
</value>
</fsapiResponse>

URL 4:

XML Parsing Error: syntax error
Location: http://192.168.1.151/fsapi/GET_MULTIPLE?pin=1234&node=netRemote.sys.net.wired.macAddress&node=netRemote.sys.net.wlan.macAddress&node=netRemote.sys.info.radioId
Line Number 1, Column 1:
404 Error
^

steenderen avatar May 24 '23 11:05 steenderen

URL1:

<fsapiResponse>
<status>FS_OK</status>
<value>
<c8_array>002261861068</c8_array>
</value>
</fsapiResponse>

URL2

<fsapiResponse>
<status>FS_OK</status>
<value>
<c8_array>00:22:61:86:10:68</c8_array>
</value>
</fsapiResponse>

URL3

<fsapiResponse>
<status>FS_OK</status>
<value>
<c8_array>00:22:61:86:10:69</c8_array>
</value>
</fsapiResponse>

URL4:

<fsapiGetMultipleResponse>
<fsapiResponse>
<node>netRemote.sys.net.wired.macAddress</node>
<status>FS_OK</status>
<value>
<c8_array>00:22:61:86:10:69</c8_array>
</value>
</fsapiResponse>
<fsapiResponse>
<node>netRemote.sys.net.wlan.macAddress</node>
<status>FS_OK</status>
<value>
<c8_array>00:22:61:86:10:68</c8_array>
</value>
</fsapiResponse>
<fsapiResponse>
<node>netRemote.sys.info.radioId</node>
<status>FS_OK</status>
<value>
<c8_array>002261861068</c8_array>
</value>
</fsapiResponse>
</fsapiGetMultipleResponse>

jwaes avatar May 24 '23 13:05 jwaes

Hi, I have a Roberts Stream 83i which has worked fine with Home Assistant until updating to 2023.5.3 Since my device uses port 2244 I had to adapt the URLs, I get the same result for the 3 URL's <fsapiResponse> <status>FS_NODE_DOES_NOT_EXIST</status> </fsapiResponse>

and the 4th URL gives the error below

This page contains the following errors: error on line 1 at column 1: Document is empty Below is a rendering of the page up to the first error.

zimjim72 avatar May 31 '23 12:05 zimjim72

I have a similar observation:

  • HA 2023.5.4 + Karcher DAB 7000i (quite new DAB+ Webradio)
  • HA told me via UI, that it has found new device so i added via GUI and got a blank integration without a device and did not find a way to use the integration
  • Found this issue, so i added device via CLI for testing purpose. Got usable entity (but no device)
  • Removed CLI like HA advised (CLI will be deprecated in 2023.6.0)
  • Still got usable entity with old entity name from CLI, but cannot manage from UI (same error message like jwaes https://github.com/home-assistant/core/issues/93272#issuecomment-1554442537)

URL-Outputs (device responds on port 80/http) URL1:

<fsapiResponse>
<status>FS_OK</status>
<value>
<c8_array>305890D88584</c8_array>
</value>
</fsapiResponse>

URL2:

<fsapiResponse>
<status>FS_OK</status>
<value>
<c8_array>30:58:90:d8:85:84</c8_array>
</value>
</fsapiResponse>

URL3:

<fsapiResponse>
<status>FS_NODE_DOES_NOT_EXIST</status>
</fsapiResponse>

URL4:

<fsapiGetMultipleResponse>
<fsapiResponse>
<node>netRemote.sys.net.wired.macAddress</node>
<status>FS_NODE_DOES_NOT_EXIST</status>
</fsapiResponse>
<fsapiResponse>
<node>netRemote.sys.net.wlan.macAddress</node>
<status>FS_OK</status>
<value>
<c8_array>30:58:90:d8:85:84</c8_array>
</value>
</fsapiResponse>
<fsapiResponse>
<node>netRemote.sys.info.radioId</node>
<status>FS_OK</status>
<value>
<c8_array>305890D88584</c8_array>
</value>
</fsapiResponse>
</fsapiGetMultipleResponse>

@wlcrs: please advise how we can help, seems we have some test-devices reachable ;-) i'm happy to produce more helpful outputs if needed

schwupp avatar Jun 05 '23 10:06 schwupp

Hi all, debugging without having a device available is always very difficult. If anyone is able to tinker with the afsapi library, that will always resolve the issue much faster than waiting for my input.

I created the smallest possible piece of code to help me rule out some issues:

Can you please run pip3 install aiohttp, and then execute the following file:

import xml.etree.ElementTree as ET
import asyncio
import aiohttp

async def test_read():
  async with aiohttp.ClientSession() as client:
    resp = await client.get("http://[ENTER YOUR RADIO IP HERE]/device")
    doc = ET.fromstring(await resp.text(encoding="utf-8"))

    print(doc)

    api = doc.find("webfsapi")

    print(api)
    print(api.text)
 

asyncio.run(test_read(), debug=True)

What does it output? If you are getting an error: does it go away if you change the encoding from "utf-8" to "ascii" ?

wlcrs avatar Jun 06 '23 07:06 wlcrs

jaco@ubuntu01:~$ python3 test.py
<Element 'netRemote' at 0x7f4c257909f0>
<Element 'webfsapi' at 0x7f4c25790950>
http://192.168.1.193:80/fsapi

jwaes avatar Jun 06 '23 07:06 jwaes

no error for both utf-8 and ascii

$ python3 test.py 
<Element 'netRemote' at 0x7fcb2aeb02c0>
<Element 'webfsapi' at 0x7fcb2aeb03b0>
http://[RADIO-IP]:80/fsapi

schwupp avatar Jun 06 '23 17:06 schwupp

No errors here either, the string of characters changes every time I run the code

<Element 'netRemote' at 0x7f2e00870720>
<Element 'webfsapi' at 0x7f2e00870770>
http://192.168.2.92:2244/fsapi

zimjim72 avatar Jun 06 '23 19:06 zimjim72

I have a test Home Assistant install running in a VM, I upgraded it to 2023.6.0 this morning & the Frontier Silicon integration is working again although I did have to add the device manually.

zimjim72 avatar Jun 08 '23 07:06 zimjim72

Seems still broken on my IR4400. After adding IR4400 in HA 2023.6.2, media browser JS starts crashing:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'hidden')
    at ha-bar-media-player.ts:467:47
    at Array.filter (<anonymous>)
    at i.value (ha-bar-media-player.ts:463:45)
    at i.value (ha-bar-media-player.ts:351:20)
    at i.value (ha-bar-media-player.ts:277:14)
    at i.update (lit-element.ts:160:24)
    at i.performUpdate (reactive-element.ts:1331:14)
    at i.scheduleUpdate (reactive-element.ts:1263:17)
    at i._$Ej (reactive-element.ts:1235:25)

image

Problem is that media_player.ir4400_00226159b480 is present in states, but not in entities.

image

http://192.168.3.14/fsapi/GET/netRemote.sys.info.radioId?pin=1234

<fsapiResponse>
<status>FS_OK</status>
<value><c8_array>00226159B480</c8_array></value>
</fsapiResponse>

http://192.168.3.14/fsapi/GET/netRemote.sys.net.wlan.macAddress?pin=1234

<fsapiResponse>
<status>FS_OK</status>
<value><c8_array>00:22:61:59:b4:80</c8_array></value>
</fsapiResponse>

http://192.168.3.14/fsapi/GET/netRemote.sys.net.wired.macAddress?pin=1234

<fsapiResponse>
<status>FS_NODE_DOES_NOT_EXIST</status>
</fsapiResponse>

http://192.168.3.14/fsapi/GET_MULTIPLE?pin=1234&node=netRemote.sys.net.wired.macAddress&node=netRemote.sys.net.wlan.macAddress&node=netRemote.sys.info.radioId

<fsapiGetMultipleResponse>
<fsapiResponse>
<node>netRemote.sys.net.wired.macAddress</node>
<status>FS_NODE_DOES_NOT_EXIST</status>
</fsapiResponse>
<fsapiResponse>
<node>netRemote.sys.net.wlan.macAddress</node>
<status>FS_OK</status>
<value><c8_array>00:22:61:59:b4:80</c8_array></value>
</fsapiResponse>
<fsapiResponse>
<node>netRemote.sys.info.radioId</node>
<status>FS_OK</status>
<value><c8_array>00226159B480</c8_array></value>
</fsapiResponse>
</fsapiGetMultipleResponse>

arcao avatar Jun 17 '23 21:06 arcao

Additional:

It does show up in the dev tools: image

But the UI link gives this error: image

This entity ('media_player.dit2005m_002261861068') does not have a unique ID, therefore its settings cannot be managed from the UI. See the [documentation](https://www.home-assistant.io/faq/unique_id) for more detail.

Which is kind of strange as ... i did NOT configure it using yaml ?

Hmmm. It might have to do with a conflict with the dlna_dmr integration https://www.home-assistant.io/integrations/dlna_dmr/

This Internet radio device triggers both integrations, and use the same device id ..

I think the problem is that AFSAPIDevice doesn't set _attr_unique_id.

arcao avatar Jun 17 '23 22:06 arcao

Thank you @arcao for doing some debugging.

As you have the default pin, your unique_id is set here: https://github.com/home-assistant/core/blob/24add59d1549bbfe6a87c8d4c648f855f12f169c/homeassistant/components/frontier_silicon/config_flow.py#L152-L156 (or https://github.com/home-assistant/core/blob/24add59d1549bbfe6a87c8d4c648f855f12f169c/homeassistant/components/frontier_silicon/config_flow.py#L121-L126 if added via the SSDP flow).

As your http://192.168.3.14/fsapi/GET/netRemote.sys.info.radioId?pin=1234 returned a valid response, it should have a valid value and the 'NotImplementendException' catch you see in these code snippets should not have triggered. So this still leaves me wondering what is going on here...

wlcrs avatar Jun 19 '23 08:06 wlcrs

Does anyone have the same issues with latest 2023.8.x ?

same problem here, my Sangean WFR-28C stopped working with last HA updates op 2023.8.x. I can add it with the UI, but there are no entities anymore.

If I check the request url : http://192.168.178.31/fsapi/GET/netRemote.sys.info.radioId?pin=1234

it correctly returns:

FS_OK 002261EB7B6C

8OND007 avatar Aug 04 '23 06:08 8OND007

Same problem here with a fresh install of Home Assistant OS 10.4 - it seems the integration is not creating any devices or entities. I'm connecting to Revo SuperConnect. The integration works, meaning the controls show up in the dashboard and they work, but there are no devices or entities created and it doesn't get a Unique ID, which means I can't assign it to an Area, change the name from UI etc. I'm able to change the friendly name from configuration.yaml. So the functions work, but the configuration from UI is not possible.

ttylenda avatar Aug 04 '23 17:08 ttylenda