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

Virtual light devices and not just entities

Open etokheim opened this issue 2 years ago • 5 comments

Hi! I might have overlooked something, but I can't seem to figure out how to add a light as a device. Is that possible with the hass-virtual component?

I want to make a scene with the virtual lights, but scenes only support devices...

etokheim avatar Feb 04 '23 19:02 etokheim

This doesn't work? They appear as entities although I've never tried one in a scene. I don't have my test system running at the moment but I'll check later.

light:
  - platform: virtual
    name: 'Light 1'

twrecked avatar Feb 04 '23 19:02 twrecked

Thanks!

My understanding is that a device is kind of a group of entities and that the scene creation tool only takes in devices.

I found that I could reference entities when manually editing the scenes.yaml file. Applying the scene changed the lights, but it's very tiresome editing scenes in yaml, compared to the UI.

I used the light from the readme (worked fine, and without any errors):

light:
  - platform: virtual
    name: 'Light 1'
    initial_value: 'on'
    support_brightness: true
    initial_brightness: 100
    support_color: true
    initial_color: [0,255]
    support_color_temp: true
    initial_color_temp: 255
    support_white_value: true
    initial_white_value: 240
    initial_availability: true

When adding a light through ie. the Hue integration, it creates a device with one or more entities attached to it. Ie. each light is one device, with one entity. The motion sensors, on the other hand, creates four entities for each device. One for motion, temperature, light level and battery.

I therefor expected the same behavior when adding virtual lights.

I ended up just adding my Hue hub to the test environment as a quick workaround.

etokheim avatar Feb 05 '23 21:02 etokheim

At the moment we don't create a device. I'll look at how to do it.

If you turn on 'advanced mode' in your user profile you can add entities to the scene from the UI. Could that be a workaround for now?

twrecked avatar Feb 05 '23 21:02 twrecked

Ah, thanks! That's a perfectly good workaround! 😃

And by the way, thank you very much for creating and maintaining this awesome component - it's really useful!

etokheim avatar Feb 06 '23 08:02 etokheim