HassOSArgonOneAddon icon indicating copy to clipboard operation
HassOSArgonOneAddon copied to clipboard

Add state_class to allow usage of the "Statistics Graph Card"

Open srjlewis opened this issue 2 years ago • 2 comments
trafficstars

Could you add state_class: measurement to the reqBody as this would allow uage of the "Statistics Graph Card" for better long term reporting and display.

srjlewis avatar May 05 '23 13:05 srjlewis

What type?

adamoutler avatar May 05 '23 16:05 adamoutler

Hi

The type would be measurement

Below is a workaround using a template sensor

template:
      - name: "Argon Fan Speed"
        unit_of_measurement: "%"
        state: '{{ states("sensor.argon_one_addon_fan_speed") }}'
        state_class: measurement
        icon: mdi:fan

I would guess that the following line would need changing from

reqBody='{"state": "'"${fanPercent}"'", "attributes": { "unit_of_measurement": "%", "icon": "'"${icon}"'", "Temperature '"${CorF}"'": "'"${cpuTemp}"'", "friendly_name": "Argon Fan Speed"}}'

to the following, but I am only guessing at the right placement

reqBody='{"state": "'"${fanPercent}"'","state_class": "measurement" , "attributes": { "unit_of_measurement": "%", "icon": "'"${icon}"'", "Temperature '"${CorF}"'": "'"${cpuTemp}"'", "friendly_name": "Argon Fan Speed"}}'

or

reqBody='{"state": "'"${fanPercent}"'" , "attributes": { "unit_of_measurement": "%", "icon": "'"${icon}"'" ,"state_class": "measurement", "Temperature '"${CorF}"'": "'"${cpuTemp}"'", "friendly_name": "Argon Fan Speed"}}'

srjlewis avatar May 05 '23 16:05 srjlewis