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

virtual.yaml will not be visible #140

Open
jojkopeter opened this issue Nov 29, 2024 · 7 comments
Open

virtual.yaml will not be visible #140

jojkopeter opened this issue Nov 29, 2024 · 7 comments

Comments

@jojkopeter
Copy link

I cannot find the virtual.yaml file.

@Tony763
Copy link
Contributor

Tony763 commented Nov 30, 2024

You can create it and put your configuration in it.

@snowdd1
Copy link

snowdd1 commented Dec 13, 2024

I am running HAOS and created the virtual.yaml in the same folder as the default configuration.yaml is located - it does not get loaded though. Do I have to link it in configuration.yaml somewhere, like with other platforms?

@twrecked
Copy link
Owner

You still need to add a virtual integration:

Settings --> Devices & Services --> Virtual Components

then choose the file you created.

@rwzdoorn
Copy link

rwzdoorn commented Dec 15, 2024

Hi, I have the same issue. How do I get the integration working?

I tried the following:

  1. I downloaded Virtual Components via HACS
  2. Added virtual: to my configuration.yaml
  3. I created a virtual.yaml file in the same folder as configuration.yaml
  4. The integration is loaded (I see it at Settings --> Devices & Services --> Virtual Compontens . When I try to add a entry I get the following error:

This integration cannot be added from the UI
You can add this integration by including it in your 'configuration.yaml'. See the documentation for more information.

I also tried to use virtual: !include virtual.yaml .

This is my virtual.yaml:

binary_sensor:

  • platform: virtual
    name: "Binary Sensor 1"
    initial_value: "on"
    class: presence

@corgan2222
Copy link

corgan2222 commented Dec 16, 2024

I had the same issue with the latest 0.9.0b18

On a bare-metal installation, the virtual.yaml is not created automatically. Maybe due to folder permission problems. Could not find any hints in the debug log.

So I created the virtual.yaml file manually (in the same folder as the configuration.yaml) with one test light and no entry in the configuration.yaml.

version: 1
devices:
  Test Light:
    - platform: light
      initial_value: "off"

Saved, and restarted, HA. Now I see my test light.

What's not working, if I created just an empty file, without the

version: 1
devices: {}

Then I got this
grafik

Now the Integration is working and showing my test device.
What's not working, is to create new virtual devices through the UI. After clicking "add Entry" I get the message to create the config yaml. I think there is something wrong, how the integration is searching for the config file on baremetal/non docker installations.

grafik

@twrecked
Copy link
Owner

There is no way to add devices directly from the UI. To add more virtual device you have 2 options:

  • add more devices to your current virtual yaml file and select "reload"
  • create a new file with the entries then choose "ADD ENTRY", choose a new group name new and point it at the new file

It's done like this because config flow doesn't have seem to be set up for this, you can't edit a list of items very easily. config flow normally lets you put enough information in to connect to a remote service that will provide the devices to HA. Here the remote service is your yaml file which you are free to edit and reload.

And I will improve the documentation about setting this up.

@corgan2222
Copy link

There is no way to add devices directly from the UI. To add more virtual device you have 2 options:

* add more devices to your current virtual yaml file and select "reload"

* create a new file with the entries then choose "ADD ENTRY", choose a new group name new and point it at the new file

It's done like this because config flow doesn't have seem to be set up for this, you can't edit a list of items very easily. config flow normally lets you put enough information in to connect to a remote service that will provide the devices to HA. Here the remote service is your yaml file which you are free to edit and reload.

And I will improve the documentation about setting this up.

ahhh, ok, this was misleading from the documentation, where you wrote, that the integration can be configured via config flow. But you meant the first installation and not the creation of the individual virtual devices. Ok, understood. So far everything is going great except for the initial hiccup. Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants