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

Where is the why and the how?

Open bilogic opened this issue 1 month ago • 1 comments

I chanced upon this because I'm looking for a way to minimize the effort to replace devices without modifying a bunch of automations and modifying my config.

e.g. I have a card that shows my tablet and phone's batteries also a automation to monitor its battery levels.

  1. So let's say I changed my phone, does this repo help reduce the overheads by just modifying stuff under virtual: to point to the new phone?
  2. If not, is there a write up on why this virtual concept exists? What problem is it trying to solve?
  3. If it is, then next is, how do I get the virtual values to follow that of the real values?
  4. Examples show all the various types, but does not show how I can connect virtual to the real link so that they are in sync

Thank you!

bilogic avatar Nov 28 '25 15:11 bilogic

  1. Maybe. Give it a try and let me know. It might be easier to change the device entity IDs.
  2. It scratches an itch I had. I have a lot of code running in appdaemon so I wanted to be able to test any changes I made before I deployed it to the "real" house. It kind of grew as I added things and I added it to HACS in case other people found it useful.
  3. See 4.
  4. When I wrote it I didn't really have that in mind but I looked at my main system and I have a couple of devices that are actually virtual. One of them is a swimming pool cover which I can't reasonably attached a sensor to but has a service which will email when I open and close the pool. For this one I:
  • set up an email address to receive these emails
  • had that email address pipe to a python script that examines the contents
  • call my Home Assistant rest API to signal if the the cover was opened or closed
  • the rest API automation calls a virtual service to set the new state
  1. (continued) It's an interesting idea being able to tie it to a another device. For now you could probably do it with an automation.

Hope that helps.

twrecked avatar Nov 30 '25 00:11 twrecked