Android: Widgets do not appear in 1.6.0 version

Created on 9 Feb 2020  路  12Comments  路  Source: home-assistant/android

Hello,
I have problem with widgets in 1.6.0 version. I can't create any. In 1.5.0 everything was ok. Old widgets don't work
Bug report grom android on attachement.
I'm using Xiaomi mi 8 se, android 9 and Nova launcher

bug

All 12 comments

There was a change to how widgets worked that very likely broke the old widgets. However, you should be able to create new ones. Is this screenshot from trying to create a new widget or launch an old one? It looks like a widget configuration crash.

FWIW I was able to create a widget in the latest build. I did not carry any over. Sometimes we do need to start over.

@KBerstene this screenshot is taken after deleting old widgets and trying to create a new one.

@piotrdal Thanks for the info. I think I have an idea of where this is originating from, but I'd like to gather a bit more info, if you don't mind. It looks like you might have a service in a format that was unaccounted for in the widget configuration setup, specifically the service auto-populate method. If I can narrow down what the service is (it doesn't seem to exist in my system), then I might be able to fix it.

I'm working in Lovelace, so I don't know if this is different for you. If you go into Home Assistant and select Developer Tools, you should have a Services tab available. If you type "log_event" in that service box, I am curious if it will auto-complete a domain and service (e.g. homeassistant.log_event). If it does, could you please provide a screenshot and perhaps the name of the integration you're using that would have the log_event option?

This is a bit of a wild guess, but are you using ESPHome and the domain and service is heat.log_events?

@KBerstene I Hope it's what you need...
i'm using edgeos integration

@piotrdal That was exactly what I was looking for. It looks like the edgeos log_events field doesn't conform to how the rest of the Home Assistant services are laid out.

~For_ future notes:~ I have submitted a pull request for edgeos to change this:
In edgeos' services.yaml, the log_events field needs to be changed to have a description member rather than just being a string member itself.

However, this doesn't fix all possible cases for importing services to the app. I'll have to look into what changes can be made to assure that this issue doesn't come up in the app if any other components are similarly non-conformist.

@KBerstene 馃憤 We shouldn't crash, but I don't think we should go too far out of way to handle custom components that don't follow the standard. We might be able to add a check for this in HA it's self to have the custom component not load at all if not conforming. Not sure how @balloob feels about that plan?

@JBassett I agree, we should just have it not load the service in the app if it fails for whatever reason. However, my only hesitation there is that we might want to add in some sort of "add custom field" button to be able to add an extra field to service data if the service you're trying to call doesn't auto-populate the fields.

Edit: I just reread your comment and realized you meant in HA itself, not just in the app. That would certainly be a change I wouldn't know how to implement, lol

@KBerstene commenting log_events in services.yaml from edgeos component enables creating widgets. Thanks a lot :)

Btw - on 1.5.0 it was working without any problems with edgeos component fully enabled

@piotrdal Awesome! I'm glad that works. You could try editing your custom_components/edgeos/services.yaml with the correction I proposed here and see if that would enable the widget configuration page to load the log_event service correctly.

The widget creation worked in 1.5.0 because it was not loading dynamic fields from the service information. The dynamic field loading is what broke it because it didn't know how to process the field when it tried to populate the services. Before that, it would load the services but not try to read any data about the fields.

Ok...hmmm...I don't know exactly how it can be changed... The services.yaml from edgeos component looks quite the same to me as the services.yaml from your link except for the comments...

I agree with @JBassett. We're not going to support formats that do not conform to our services format.

Home Assistant currently doesn't check it because it is provided by the developer, and so should follow our formats but I guess it doesn't always. Better fix the custom integration.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jokerigno picture jokerigno  路  4Comments

Anonym-tsk picture Anonym-tsk  路  3Comments

N-Schaef picture N-Schaef  路  5Comments

andriej picture andriej  路  4Comments

rradar picture rradar  路  4Comments