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

Virtual device is not created

Open gitcodeB opened this issue 2 years ago • 8 comments

image

I did like above and restart HA.

image image

But the device doesn't appear. What is the problem?

gitcodeB avatar Apr 02 '23 10:04 gitcodeB

Hi @codinghb, try it like this:

virtual:

fan:
  - platform: virtual
    name: "remote fan"
    speed: True
    speed_count: 4
    direction: False
    oscillate: True
    initial_availability: True

Tony763 avatar Apr 02 '23 11:04 Tony763

thanks for reply. I did, but it doesn't be still created.

gitcodeB avatar Apr 02 '23 11:04 gitcodeB

Even after HA restart? Coul You post a log here?

Tony763 avatar Apr 02 '23 11:04 Tony763

Even after HA restart? Coul You post a log here?

Yes I restarted HA several times. Where is the log you want and which keyword for searching in log?

gitcodeB avatar Apr 02 '23 12:04 gitcodeB

I

Even after HA restart? Coul You post a log here?

I found the reason. I already wrote code for other template fan and have it.

The code's order is..

Line 40 fan:

  • platform: template..

Line 50 fan:

  • platform: virtual...

After deleting code for template fan, the virtual device was created. In addition, in case the first code is for virtual and second one is for template, only virtual fan was created.

so, Can't I have your virtual device and template fan at the same time?

In addition, I found virtual fan is not created two more.

For exmaple,

Line 1 fan:

  • platform: virtual name: fan 1 ..

Line 10 fan:

  • platform: virtual name: fan 2

Only fan 1 was created and fan 2 wasn't created.

Can't I have two more virtual devices?

Thanks.

gitcodeB avatar Apr 02 '23 14:04 gitcodeB

You can. But you can't have more than 2 fan: entries, that is a Home Assistant configuration limitation/design.

fan:
- platform: virtual
  name: fan 1
- platform: virtual
  name: fan 2

twrecked avatar Apr 02 '23 14:04 twrecked

okay, thanks,

Can I use this entity for trigger of automations? I don't know trigger code

gitcodeB avatar Apr 02 '23 14:04 gitcodeB