I’m trying / failing to track device availability state via InfluxDB / Grafana - state 0/Off and 1/On is sent, but not ‘Unavailable’. It seems previous discussion on this subject usually end with ‘unavailable is not a state’ - this makes sense in the ‘power on=1, power off=0’ context, but state ‘unavailable’ seems highly relevant in the connected device / IoT universe.
Suggested feature: log unavailable state as -1 in HASS. Perhaps there’s a dev reason not to do this, or perhaps this flies in the face of established ‘state logic’ (thou shalt not apply negative values to state). If that’s the case, is there an easy way to create a custom state ‘unavailable = -1’ as default for all entities, rather than creating applying a custom sensor template to each one?
Ultimately, I’m working to improve stability across my connected devices - this includes fine-tuning wifi settings, experimenting with different protocols, and testing different hubs. The example that raised this suggestion: my TP-Link (hs300) devices have always experienced intermittent connectivity issues in HASS - I’ve fine-tuned like mad and am now controlling them via a separate Node-Red container. It would be very helpful to compare availability metrics between Node-Red and HASS-connected devices as I chase root cause (which probably will end up ‘TP-Link is just a terrible smartswitch platform’). Of course, this is just one example - overall, I’d like to compare availability between protocols (Z-Wave, Zigbee, wifi, etc), vendors (Hue, LIFX, GE, etc.), access points, rooms, etc. My relevant data resides in InfluxDB, so HASS history doesn’t help.