Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to modify options or add the integration in HA 2021.3 #299

Closed
mpikosdimitris opened this issue Mar 5, 2021 · 17 comments · Fixed by #300
Closed

Not able to modify options or add the integration in HA 2021.3 #299

mpikosdimitris opened this issue Mar 5, 2021 · 17 comments · Fixed by #300
Labels
bug Something isn't working

Comments

@mpikosdimitris
Copy link

Hello and thanks for you excellent work.
I have a problem with the selection of HCI interface. On Passive BLE Monitor options menu, i can't select any of the interfaces 0,1,2 and always showing the nymbers 0,1,2 without any change of my options. I've tried to reinstall the addon form HACS, to clear the cash of my browser, tried different browser, tried from the HA app in my mobile device. Nothing. What can i do ? Also, is there a place that i can find my discovered devices (something like the YAML file) to manually add/change the bind key or something else ?
Capture
Thanks
Dimitris

@Ernst79
Copy link
Collaborator

Ernst79 commented Mar 5, 2021

To start with your last question, you can see your discovered devices by clicking on Devices at the bottom (see your printscreen, last option below Restore State. After clicking Submit, it will open a new window with options for that specific device.

image

Regarding your first issue, l see an error user input malformed. I can confirm your issue, I will look into it.

image

@mpikosdimitris
Copy link
Author

mpikosdimitris commented Mar 5, 2021

I select interface 0 then i select the device, pessing 'Submit' and i get the same error. If you see, the interfaces 0, 1, 2 seems like are always selected, but yesterday while i was changing my selections the interface that i select was only showing in the HCI Interface.
(Sorry for my english)
Capture

@Ernst79
Copy link
Collaborator

Ernst79 commented Mar 5, 2021

Yes, I see the same behavior. I will investigate it.

I checked the following (work in progress)

  • Hmm, after deleting the integration and re-adding, still the same error.
  • Installed 1.1.4, same error
  • Installed 1.0.0, same error
  • Checked my other HA instance, only checked the Report Unknown option, same error.
  • I downgraded HA to 2021.2.3, now it works again. Changing things also works normally. So, there has to be some change in HA that is causing this issue.

@mpikosdimitris
Copy link
Author

I'm in 2021.3.0 with the same behavior. Can i find somewhere the data of my discovered devices to change something ? In my case, i want to add the encryption key in one of my devices.

@Ernst79
Copy link
Collaborator

Ernst79 commented Mar 5, 2021

I explained above, you can change it here

image.

A pull down menu will open, select your device (by MAC address), click on submit and a new window will open.

But I think it won't work in your case, because of the errors with the form.

Still looking into it, I have to find out what changed in HA 2021.3.x

@mpikosdimitris
Copy link
Author

mpikosdimitris commented Mar 5, 2021

Yes i know, i configured my other sensors with that way. Just asking if there is another way to configure it because it's not working.
Thanks again for your support.

@Ernst79
Copy link
Collaborator

Ernst79 commented Mar 5, 2021

I'm afraid the only way is in YAML at the moment. Or downgrading to 2021.2.3.

I need some time to find out what is changed. I don't see a breaking change that could have caused this.

Note to myself: It seems to wrong in the config flow. Strangly, all intermediate data in the code during the config flow seems to be the same as in 2021.2.3, At the end of _show_user_form, it seems to stop after

        return self.async_show_form(
            step_id=step_id, data_schema=config_schema, errors=errors or {}
        )

In 2021.2.3, I noticed that async_step_user was runned again, with the new data. In 2021.2.3, nothing seems to happen. errors is still empty, but it does show an error on the form.

I'll continue tomorrow with further debugging. Very strange this ....

@Ernst79 Ernst79 added the bug Something isn't working label Mar 5, 2021
@Ernst79 Ernst79 pinned this issue Mar 5, 2021
@Ernst79 Ernst79 changed the title Can't select HCI Interface Not able to modify options or add the integration in HA 2021.3 Mar 5, 2021
@Ernst79
Copy link
Collaborator

Ernst79 commented Mar 6, 2021

OK, I narrowed it down to the devices option, which is causing the issue. If I remove the devices option from the config flow (the menu in the screenshot, it all works fine.

Might be related to this issue home-assistant/supervisor#2690

@SPEC1AL1ST
Copy link

SPEC1AL1ST commented Mar 7, 2021

Same error
https://c2n.me/4bdn2dd

@ilkanaev
Copy link

ilkanaev commented Mar 7, 2021

i have the same isue.
at the first stage the only way to add new device is by selecting all the HCS interfaces.
once added. no any option to add more. update or delete already added.
i tryed to get back to the older version - did not help.

@Ernst79
Copy link
Collaborator

Ernst79 commented Mar 7, 2021

Workaround to change options is selecting HCI 0 and 1, next select only 0 (assuming you use hci0), change the option you want to change and click submit.

I’m still looking into it, unfortunately I don’t have a clue what is wrong. It looks like an issue with the config validation of either the hci field and/or the devices field. @Magalex2x14 @koying could you help me solving this issue, I’m starting to feel a bit lost.

A new installation of the integration will fail at the moment. A workaround is changing the following in config_flow.py. This will at least open the menu. Next, use the workaround with the hci option as above (select0 and 1, and next select 0 and submit).

       vol.Optional(CONF_DEVICES, default=[]): vol.All(
            cv.ensure_list, [DEVICE_SCHEMA]
        ),

to

      vol.Optional(CONF_DEVICES, default=[]): vol.All(
           cv.ensure_list, cv.string
       ),

@TwinsenLiang
Copy link

I'm in 2021.3.0 with the same behavior. Can i find somewhere the data of my discovered devices to change something ? In my case, i want to add the encryption key in one of my devices.

same to me。

@Ernst79 Ernst79 mentioned this issue Mar 8, 2021
@Ernst79
Copy link
Collaborator

Ernst79 commented Mar 8, 2021

I finally found the error. In the end, it was an easy fix, when you know what to look for :-). The issue was in the HCI field, after changing the "multi_select config validation" from a dictionary to a list, it all starts to work again.

Please update to 1.3.0-beta to check. Please report back if it works for you, I would like to release the final a.s.a.p. after confirmation that it works.

A beta can be installed in HACS by clicking the three dots on the BLE monitor integration tile, reinstall, select the "show beta versions" button and install. Make sure you restart Home Assistant after the update.

@TwinsenLiang
Copy link

I finally found the error. In the end, it was an easy fix, when you know what to look for :-). The issue was in the HCI field, after changing the "multi_select config validation" from a dictionary to a list, it all starts to work again.

Please update to 1.3.0-beta to check. Please report back if it works for you, I would like to release the final a.s.a.p. after confirmation that it works.

A beta can be installed in HACS by clicking the three dots on the BLE monitor integration tile, reinstall, select the "show beta versions" button and install. Make sure you restart Home Assistant after the update.

yeah,fix it。thank u

@Ernst79
Copy link
Collaborator

Ernst79 commented Mar 8, 2021

Thx. Final version 1.3.0 is released.

@ilkanaev
Copy link

ilkanaev commented Mar 8, 2021

works fine for me.
thank you very much for fix !

@mpikosdimitris
Copy link
Author

Thx. Final version 1.3.0 is released.

Just upgraded it ! Thank you very much !

@Ernst79 Ernst79 unpinned this issue Apr 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants