I have a REST sensor that returns some JSON attributes, but unfortunately it doesn’t always reply. HA throws this as a warning/error when this happens.
I’m trying to template the JSON attributes to define a default value, but not having much joy
Probably explains why I’m failing (I have limited knowledge/experience with HA/templates).
I have implemented a workaround by creating two separate sensors who’s states are set based on the JSON response (and templated a default value that way - which I’m hoping works):
Obviously this means twice the amount of HTTP requests/replies (one for ScreenOn and one for screenBrightness). Can you think of a way of more efficient way of specifying a default value for the JSON attributes (with a single HTTP request)?
I didn’t realise you could do that with the rest integration, I thought there was purely rest commands and rest sensors, I didn’t know there was a generic rest integration where you could create sensors based on the single call/response.
It still throws some errors due to the device not responding/etc, but at least my log isn’t being flooded by the sensor rest errors