Bug or Doc update?: State card does not appear within main panel on hello world example

Hi,

I followed the hello world example in the Development 101, and contrary to what it said, the state card does not appear within main panel.

I setup my dev environment following the Set up Development Environment doc just last week.

Is the doc out of date, or is this a bug?

Em

Have you edited your Lovelace UI? If so, entities are no longer automatically added.

I am no DEV, but I do know that recent updates have caused custom components to need a file called init.py in the folder (this can be a blank file, just needs to be present).

I also saw something about some needing a manifest.json, but I am not sure if this is a requirement, or just needed for some data to work.

Again, I haven’t done any development myself, but to me it looks like the documents need to be updated.

Aha ! Thanks @anon34565116. So it is a doc update that is needed. Can you kindly point me out to the part of the doc that explains how to update Lovelace for the hello world example? I will update it and submit a pull request.

Here is a page describing the changes:

snipit:

Each integration is either a single Python file, or a folder with an  `__init__.py` . file. We have updated the documentation and introduced a new section for [integrations](https://developers.home-assistant.io/docs/en/creating_integration_file_structure.html).

Home Assistant 0.92 introduces a new [ `manifest.json` ](https://developers.home-assistant.io/docs/en/creating_integration_manifest.html) for integrations. This file, which is optional for custom components, is used by integrations to specify metadata: name, link to the documentation, dependencies, requirements and code owners.

Thanks @DeadEnd. Will see what I can do.

I just realized I started looking at dev for Hassio addons, not HA custom components.

I don’t get it @DeadEnd: the link does not mention anything about the hello world example or setting up a state card for the Lovelace UI… Can you clarify, please?

Ah… @anon34565116. ok. Waiting for someone else to add info. Or else, I will open am issue on GitHub.

1 Like

Okay, this is my basic stab at how it works now.
In you custom components folder, you’ll need to create a subfolder called hello_world (or whatever you want to call it.

inside the hello_world folder, create based on what the component is… I am not sure what the hello-world is considered (sensor, notify, etc.) but if it is a sensor you would create sensor.py and put the code there.

You also need the init.py file in the hello_world folder… and possibly the manifest.json…
Take all this with a grain of salt… I am basing this off what I see in the custom components I am using and what I have seen in release notes.

Anyway, I expect the document is outdated and needs a bit of work to be up with all the changes that have been made that effect custom components.

Yep @DeadEnd, this is pretty much how it works. Following the steps in the doc link I provided does work but for the state card. Hence my question.

All I am looking for now is whether there is a bug (and the state card should have been automatically created), or whether there are steps that once must take to have this state card created (and the doc showing how to do it).

You may want to ask on Discord. The devs tend to hang out there.

Just did that.

1 Like