Thanks.
I know how to make simple sensors myself.
In this case, I don't know how to approach the matter.
chatgpt wrote me the following:
To add to configuration.yaml:
input_number:
block_1_consumption:
name: "Block 1 Consumption"
min: 0
max: 10000
step: 0.01
unit_of_measurement: 'kWh'
block_2_consumption:
name: "Block 2 Consumption"
min: 0
max: 10000
step: 0.01
unit_of_measurement: 'kWh'
block_3_consumption:
name: "Block 3 Consumption"
min: 0
max: 10000
step: 0.01
unit_of_measurement: 'kWh'
block_4_consumption:
name: "Block 4 Consumption"
min: 0
max: 10000
step: 0.01
unit_of_measurement: 'kWh'
block_5_consumption:
name: "Block 5 Consumption"
min: 0
max: 10000
step: 0.01
unit_of_measurement: 'kWh'
and also in automations.yaml
- id: '1739128677653'
alias: Monitoring consumption by blocks
description: ''
triggers:
- entity_id: sensor.elektro_network_tariff
trigger: state
conditions: []
actions:
- target:
entity_id: "{% if is_state('sensor.elektro_network_tariff', '1') %}\n input_number.blok_1_consumption\n{%
elif is_state('sensor.elektro_network_tariff', '2') %}\n input_number.blok_2_consumption\n{%
elif is_state('sensor.elektro_network_tariff', '3') %}\n input_number.blok_3_consumption\n{%
elif is_state('sensor.elektro_network_tariff', '4') %}\n input_number.blok_4_consumption\n{%
elif is_state('sensor.elektro_network_tariff', '5') %}\n input_number.blok_5_consumption\n{%
endif %}\n"
data:
value: '{{ (states(''sensor.p1_meter_power_phase_3'')|float / 1000) }}
'
action: input_number.set_value
mode: single
Otherwise, chatgpt explained to me what this is supposed to do and input_number actually adds something up for me by blocks. I'm not sure this is the right way, especially since, if I understand correctly, these sensors are cumulative, so they don't do monthly cumulatives, but add up until it exceeds the value of 10,000!