Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95414

Output value adjustment

$
0
0

@xion2000 wrote:

I’d like to be able to adjust a value from a sensor so the adjusted value or something else like a message is displayed.
I use PVOutput to upload lots of energy data too then I link it into HA. I know how to implement rules in PVOutput but not in HA.
My 1st example
PVOuput does not plot data when the figure is 0, so I get a rule to change any 0’s to 1’s. I monitor the energy usage of a fan which displays 1 when not running in HA, I would like to be about to tell HA to change a 1 to a 0 (a reverse of what PVO does) or possibly even better would be to say “FAN OFF” when HA sees 1.
Below is one of my sensors where I’m guessing I can add some configuration data

  - platform: pvoutput
    system_id: xxxxx
    name: wood_burner_fan 
    api_key: xxxxxxxxxxxxxxxxxxxxxxxxxx
    scan_interval: 150
  - platform: template
    sensors:
     power_consumption5:
       value_template: '{% if is_state_attr("sensor.wood_burner_fan", "power_consumption", "NaN") %}0{% else %}{{ state_attr(''sensor.wood_burner_fan'', ''power_consumption'') }}{% endif %}'
       friendly_name: 'Wood Burner Fan Electricity Using'
       unit_of_measurement: 'Watt'
     energy_consumption5:
       value_template: '{{ "%0.1f"|format(state_attr(''sensor.wood_burner_fan'', ''energy_consumption'')|float/1000) }} {{ "%0f"|format(state_attr(''sensor.wood_burner_fan'', ''energy_consumption'')|float+1) }}'
       friendly_name: 'Wood Burner Fan Electricity Used'
       unit_of_measurement: 'kWh'```

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95414

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>