flixlix / power-flow-card-plus

A power distribution card inspired by the official Energy Distribution card for Home Assistant
558 stars 68 forks source link

[Invert YAML value in HOME] #281

Closed Indianagrenoble closed 1 year ago

Indianagrenoble commented 1 year ago

Dear Félix,

I try to invert an YAML value in your code...

My code

type: custom:power-flow-card-plus
entities:
  home:
    entity: sensor.solarnet_power_load
    color_icon: true
    color_value: true
    subtract_individual: false
    override_state: true
    secondary_info:
      color_value: false
      icon: ''
    name: Le Bruyant
  fossil_fuel_percentage:
    entity: sensor.co2_signal_co2_intensity
    icon: mdi:leaf
    color_icon: true
    display_zero: false
    name: Non Fossil
    state_type: power
    color_value: true
    display_zero_state: false
  grid:
    icon: mdi:transmission-tower
    name: <JPEM/EDF>
    entity: sensor.victron_grid_load
    color_icon: true
    color_circle: true
    color:
      consumption:
        - 158
        - 5
        - 5
      production:
        - 88
        - 98
        - 228
    display_state: one_way
    invert_state: false
  solar:
    icon: mdi:solar-panel-large
    entity: sensor.solarnet_power_photovoltaics
    secondary_info:
      entity: sensor.pv_cave_power
      color_value: false
      unit_white_space: false
    color_value: false
    color_icon: true
    display_zero_state: true
  battery:
    name: Batterie Pylontech
    icon: mdi:battery-charging-100
    entity: sensor.victron_battery_power_system
    state_of_charge: sensor.victron_battery_state_of_charge_system
    color_icon: true
    color_circle: true
    display_state: one_way
    color:
      consumption:
        - 230
        - 15
        - 0
      production:
        - 2
        - 242
        - 18
    invert_state: true
    state_of_charge_unit: '%'
    color_state_of_charge_value: true
  individual1:
    entity: sensor.ballon_ec_power
    icon: mdi:heating-coil
    color: '#80b8ff'
    color_icon: true
    color_value: false
    display_zero: true
    name: Radiats/EC
    secondary_info:
      entity: sensor.compteur_intelligent_wifi_phase_a_power
      icon: mdi:radiator
      display_zero: true
      color_value: false
      unit_of_measurement: W
    unit_of_measurement: W
    calculate_flow_rate: true
  individual2:
    color_icon: true
    display_zero: true
    color:
      - 98
      - 116
      - 254
    icon: mdi:dishwasher
    entity: sensor.smart_plug_2211016174998851080748e1e9aee0b1_power
    secondary_info:
      entity: sensor.smart_plug_2211014476143351080748e1e9aedfed_power
    name: Vaiss. / Linge
    color_value: false
    display_zero_state: true
    calculate_flow_rate: true
w_decimals: 0
kw_decimals: 2
min_flow_rate: 0.9
max_flow_rate: 6
watt_threshold: 10000
clickable_entities: true
title: Flux énergétiques Le Bruyant
display_zero_lines: true
use_new_flow_rate_model: false

image

Thanks for your help

flixlix commented 1 year ago

Hey, inverting from a negative home value to a positive home value is unfortunately not possible and you will have to create a new template sensor that multiplies that value by -1

Indianagrenoble commented 1 year ago

Could you explain me how I do this please ? How create a template sensor with value x -1 ? bye here ? image

flixlix commented 1 year ago

I don't know how much you know about how to access the YAML config files, just let me know if you need any help with that, otherwise, access you configuration.yaml and type in:

template:
  - sensor:
    - name: "THE_NAME_YOU_WANT_TO_HAVE"
      unit_of_measurement: "W"
      state: {{ (states('sensor.YOUR_ENTITY_ID') |float) * -1 }}
Indianagrenoble commented 1 year ago

You are the King Félix !

I have have a full access to my Configuration.yaml file by Studio Code Server and File Editor too...

Thank you very much ;)

With your help, I progress slowly but strongly !

flixlix commented 1 year ago

Wow, thank you for the compliment 😅 I'm glad I was able to help you!

Indianagrenoble commented 1 year ago

Dear Felix,

I would like Add more Consumers inside house monitored...

Do you think Is it possible ?

Best Regards Alexandre