Closed fabsenet closed 3 years ago
State management is best done in a central place. If you are using Home Assistant, you could always use automation there or store the values. I would assume that adding DB level capabilities in current service which is performing so efficiently would needlessly bloat and may affect efficiency in future or system with low specs
With that said, I think this kind of arrangement should be for linux systems as well
@manju-rn I either failed to made my request understandable in the first place or I am now unable to understand any of your comment, sorry
to solve my problem, I noticed all sensors become unavailable whenever the pc is not reachable or simply powered down. I use that as a self made on/off info. See the value_template in my template switch. The switch position follows the powered on/off state of the pc.
switch:
- platform: template # https://www.home-assistant.io/integrations/switch.template/
switches:
mysuperswitch:
value_template: '{% if states("sensor.myrandomsensor")!="unavailable" %}on{% else %}off{% endif %}'
....snipped
Thanks for creating an issue!
It would certainly be possible to add a sensor with a different Last Will message to serve as a device tracker but I'm not entirely convinced to assume unavailable == off
. At least, not for all devices and all users. In your template sensor you do exactly that because it makes sense for your situation and it's a good solution for that. I'll close this for now, please reopen if you don't agree :)
Hi,
can you add a sensor which will only send "on" or something but also has a last will of "off" so this can be used as a faster device_tracker for the PC? currently I am using discovery of my router (fritz) and with that, it stays online for 180s after shutdown.
Would be great!