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

No virtual.yaml was created. Creating one does not work #88

Open
borgqueenx opened this issue Dec 17, 2023 · 8 comments
Open

No virtual.yaml was created. Creating one does not work #88

borgqueenx opened this issue Dec 17, 2023 · 8 comments

Comments

@borgqueenx
Copy link

In my HA's config folder there is no virtual.yaml file. i tried searching for it, no results. I created a new one in the config folder, and even after a reboot it is not creating anything.
i populated the virtual.yaml with the following:
`devices:
Living Room Lights:

  • platform: light
    initial_value: 'on'
    support_brightness: true
    initial_brightness: 100`

Help would be appriciated, thanks!

@twrecked
Copy link
Owner

If you went straight to the alpha without upgrading then you'll need to add a Virtual integration to handle the defines. (It is alpha and the docs need updating.)

Go to Settings --> Add Integration and search for Virtual.

Make sure the defaults look good - ie, point to the file you created - and click submit.

@qdatk
Copy link

qdatk commented Dec 28, 2023

Okay, so currently trying to add the integration (v0.8.0.1) brings up the message that it can't be added through the UI: "This device cannot be added from the UI. You can add this device by adding it to your 'configuration.yaml'. See the documentation for more information." The only option is to open the documentation. What was the old config for configuration.yaml, if that still works?

Edit: Found the old instructions on archive.org, and it seems to work fine!

@c3p0vsr2d2
Copy link

@qdatk could you please elaborate on what you had to change to get it to work?
I have a "virtual:" in configuration.yaml, and sensors coded up as per 0.9 instructions, but do not see any sensors being actually created. Further, trying to add integration pops up an error dialog that it cannot be added via the UI ...

@qdatk
Copy link

qdatk commented Jan 2, 2024

@qdatk could you please elaborate on what you had to change to get it to work? I have a "virtual:" in configuration.yaml, and sensors coded up as per 0.9 instructions, but do not see any sensors being actually created. Further, trying to add integration pops up an error dialog that it cannot be added via the UI ...

Did you add sensors under "virtual:"? They need to be their own section. I made this mistake the first time round. Also, it will not appear in the UI's list of integrations or devices, but only under entities.

@c3p0vsr2d2
Copy link

c3p0vsr2d2 commented Jan 2, 2024

thanks @qdatk, I did the following:

  1. Add a "virtual:" in configuration.yaml (empty - no sensors)
  2. Add specific sensors in a separate file called virtual.yaml (under /config, using a template defined in the v0.9 documentation)

I am not able to get it to work with these changes (no sensors with same names as defined in virtual.yaml, or anything similar). I am not able to add the integration from the GUI since it throws an error dialog saying it cannot be added via the UI.

Is there anything else I am missing?

@qdatk
Copy link

qdatk commented Jan 2, 2024

thanks @qdatk, I did the following:

  1. Add a "virtual:" in configuration.yaml (empty - no sensors)
  2. Add specific sensors in a separate file called virtual.yaml (under /config, using a template defined in the v0.9 documentation)

I am not able to get it to work with these changes (no sensors with same names as defined in virtual.yaml, or anything similar). I am not able to add the integration from the GUI since it throws an error dialog saying it cannot be added via the UI.

Is there anything else I am missing?

Put something like this in configuration.yaml:

binary_sensor:
  - platform: virtual
    name: 'Binary Sensor 1'
    initial_value: 'on'
    class: presence

@twrecked
Copy link
Owner

twrecked commented Feb 4, 2024

Can you try the latest build, the code might have used the wrong directory.

@c3p0vsr2d2
Copy link

I restarted from scratch again around New Years, and it started working.
Please close this issue.
Many thanks for hass-virtual and pyaarlo !

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

4 participants