hass-virtual icon indicating copy to clipboard operation
hass-virtual copied to clipboard

virtual.yaml will not be visible

Open jojkopeter opened this issue 11 months ago • 7 comments

I cannot find the virtual.yaml file.

jojkopeter avatar Nov 29 '24 17:11 jojkopeter

You can create it and put your configuration in it.

Tony763 avatar Nov 30 '24 09:11 Tony763

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?

snowdd1 avatar Dec 13 '24 15:12 snowdd1

You still need to add a virtual integration:

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

then choose the file you created.

twrecked avatar Dec 13 '24 16:12 twrecked

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

rwzdoorn avatar Dec 15 '24 20:12 rwzdoorn

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

corgan2222 avatar Dec 16 '24 19:12 corgan2222

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.

twrecked avatar Dec 16 '24 19:12 twrecked

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!

corgan2222 avatar Dec 17 '24 06:12 corgan2222