twrecked / hass-virtual

Virtual Components for Home Assistant
GNU General Public License v3.0
167 stars 28 forks source link

Virtual device is not created #61

Open gitcodeB opened 1 year ago

gitcodeB commented 1 year ago

image

I did like above and restart HA.

image image

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

Tony763 commented 1 year ago

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
gitcodeB commented 1 year ago

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

Tony763 commented 1 year ago

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

gitcodeB commented 1 year ago

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 commented 1 year ago

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:

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:

Line 10 fan:

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

Can't I have two more virtual devices?

Thanks.

twrecked commented 1 year ago

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
gitcodeB commented 1 year ago

okay, thanks,

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

github-actions[bot] commented 3 months ago

This issue is stale because it has been open for 365 days with no activity. This issue will be automatically closed within 28 days if there is no further activity.