HASwitchPlate / openHASP-custom-component

Home Assistant custom component for openHASP
https://www.openhasp.com
MIT License
51 stars 12 forks source link

more than one plate don't show in the integrations #86

Closed xtimmy86x closed 1 year ago

xtimmy86x commented 2 years ago

Hi, i've successfull installed the custom component but, with my first plate HA discovered it automatically but when i configure the second plate, it never be discovered

dgomes commented 2 years ago

Can you provide home assistant logs ?

fvanroie commented 2 years ago

Can you test if the latest commit #65767fc from the main branch fixes the issue?

xtimmy86x commented 2 years ago

I found one thing if I delete the one already configured plate then restart home assistant and rediscovery the plates, it finds both of them

dgomes commented 2 years ago

I've push a new commit yesterday that probably addresses this issue ;)

kquinsland commented 2 years ago

I've push a new commit yesterday that probably addresses this issue ;)

It does not.


I have several L8 devices on my network; 5, 3 of which are deployed and always have power/connectivity; the other two are dev units that are usually powered off.

For this post, I am working with a plate that I call bathroom. I am trying to see if reloading the integration clears out the user re-named entity IDs and also figure out why all 3 relays show up as switch. class when two of them are configured as Light Relay on the config/gpio page.

I used HACS to pull down the latest from main branch . I confirmed that the latest code was pulled down by opeining __init__.py and confirming that the line "mdi:gesture-tap-box" shows up on 349 as this commit would indicate: https://github.com/HASwitchPlate/openHASP-custom-component/commit/5be578ed9f657c3fa70155c8d8048037a418c0d1

I found the string I expected in the location that I should: i have the latest code.

I then changed MINOR = "6" to MINOR = "7" and then restarted home assistant. I then went to the config/integrations URL in HA and clicked the openHasp/bathroom device

I was happy to see that the reset button is now present next to moodlight!

I then removed the openHasp/bathroom integration and restarted the server. After things booted back up, I clicked the "Set up a new integration" button and searched for openHasp and clicked. I got the usual Configuration is done through discovery error rather than the "new device / what do you want to name this device?..." flow.

The first time after HA start up, I see this in the logs:

2022-01-31 19:14:28 ERROR (MainThread) [custom_components.openhasp.config_flow] Discovery Only
2022-01-31 19:14:29 DEBUG (MainThread) [custom_components.openhasp.config_flow] Discovered: {'node': 'entryway', 'mdl': 'Lanbon L8', 'mf': 'openHASP', 'hwid': 'deadbeefab', 'pages': 12, 'sw': '0.7.0', 'uri': 'http://1.2.3.4', 'input': {}, 'power': [], 'light': [], 'dim': [12], 'disp': [240, 320]}

That device already exists within HA and did not need to be re-configured.

I then went around and detached the faceplate from 2 of the 4 (had 5, deleted bathroom, now there are 4 total open hasp devices registered in HA and 2 of the 4 are powered off) devices and re-ran HA discovery and got the singular ERROR (MainThread) [custom_components.openhasp.config_flow] Discovery Only line.

If I keep the 2 known devices off and restart HA and then re-do the "add integration" I get the I got the usual Configuration is done through discovery error but then I get the "new device / what do you want to name this device?..." flow.

Logs:

2022-01-31 19:34:48 ERROR (MainThread) [custom_components.openhasp.config_flow] Discovery Only
2022-01-31 19:34:48 DEBUG (MainThread) [custom_components.openhasp.config_flow] Discovered: {'node': 'bathroom', 'mdl': 'Lanbon L8', 'mf': 'openHASP', 'hwid': 'deadbeef', 'pages': 12, 'sw': '0.7.0', 'uri': 'http://1.2.3.4', 'input': {}, 'power': [12], 'light': [14, 27], 'dim': []}

However I made a mistake when I added the device. I accidentally used the name bathrrom. On disk, I already have a yaml file with the slug bathroom. No big deal, I can just rename the integration...right?

Nope. The rename operation did work in the UI but - even after restarting HA - I still get this error:

 No YAML configuration for bathrrom, please create an entry under 'openhasp' with the slug: bathrrom 

So I delete the integration and try to re-discover. Nothing found... even though 4 of the 5 devices are powered off.

I restart the HA server and then attempt to add a new openHasp integration. This finds the device. I don't make a typo this time :).

The discovery payload above looks like the GPIO is correct this time... but there is no switch. class entity ID... only the 2 light relays are present :(. The screen burn in toggle switch that used to be just above the "restart" button is also not present.

fvanroie commented 2 years ago

The discovery payload above looks like the GPIO is correct this time... but there is no switch. class entity ID... only the 2 light relays are present :(. The screen burn in toggle switch that used to be just above the "restart" button is also not present.

The last two items are related to #95.

fvanroie commented 1 year ago

This has been fixed in 0.7.0

wasn-eu commented 1 year ago

it is not solved in 0.7.0 i wanted to add a second display but could not get it to discover.

Solution:

delete the first display and restart HomeAssistant. after that both displays are discovered