#Trying to figure out how to get an accurate and quickly updated Wattage from my UPS using NUTS

1 messages · Page 1 of 1 (latest)

sly junco
#

I have this in my template sensors list and it is working somewhat but very slow and inaccurate it seems

        unit_of_measurement: "W"
        value_template: "{{ states('sensor.apc_load')|float * 0.01 * 900 }}"```
my NUTS setup on my server is pretty standard https://www.kreaweb.be/diy-home-server-2021-software-proxmox-ups/
my UPS is a APC BR1500MS2 and you can see the spec sheet here https://iportal2.schneider-electric.com/Contents/docs/BR1500MS2_DATASHEET.PDF
KREAWEB

When building a home lab server, you’re almost always going to use some kind of Uninterruptible Power Supply (UPS). Let's install some tools to monitor the system.

thin turret
#

In theory a standard template sensor gets triggered by every state change of any of the sensors it references. However, to prevent HA's event system to get overloaded by poorly designed templates, each standard template sensor only changes its output value once in some specific time period. What exactly that time period is depends on how broad the queried source sensors are specified. I don't recall the exact time periods, but it will be something like once every second or 30 seconds or so: the template sensor's value will not change more often than this time period, even if the source sensor(s) do change more often. This could result in your perceived 'slow' response. (https://www.home-assistant.io/integrations/template/#rate-limiting-updates). Of course, if the integration doesn't update the source sensor often enough, you can try what ever you want, but you can never get faster updates than your integration provides them.
A work around for the rate limiting feature is to explicitly define the trigger(s) that trigger an update of your template sensor: if you make your existing template sensor into a triggered template sensor, specifying the state change of your source sensor as its trigger, your sensor will change with every change of that source sensor again. https://www.home-assistant.io/docs/automation/trigger/#state-trigger

Home Assistant

All the different ways how automations can be triggered.

Home Assistant

Instructions on how to integrate Template Sensors into Home Assistant.