Alright, so first of all, thanks for your interest in helping, I really do appreciate it!
I looked at the template page you sent me, and I think I worked something out that looks like it should work. However, when I added this to my configuration.yaml, I can’t validate my configuration in the server tab (it just loads endlessly after being pressed), and I can’t restart my Home Assistant neither. Any ideas?
sensor:
- platform: template
sensors:
forbruk_kwt:
friendly_name: "Forbruk, kWt"
unit_of_measurement: 'kWt'
value_template: state_attr('sensor.real_time_consumption', 'accumulatedConsumption')
icon_template: mdi-lightning-bolt
- platform: template
sensors:
forbruk_nok:
friendly_name: "Forbruk, NOK"
unit_of_measurement: 'NOK'
value_template: state_attr('sensor.real_time_consumption', 'accumulatedCost')
icon_template: mdi-cash
EDIT:
Sorry, I’m an idiot. I messed up the indentation, and my configuration now looks like this:
sensor:
- platform: template
sensors:
forbruk_kwt:
friendly_name: "Forbruk, kWt"
unit_of_measurement: 'kWt'
value_template: state_attr('sensor.real_time_consumption', 'accumulatedConsumption')
icon_template: mdi-lightning-bolt
- platform: template
sensors:
forbruk_nok:
friendly_name: "Forbruk, NOK"
unit_of_measurement: 'NOK'
value_template: state_attr('sensor.real_time_consumption', 'accumulatedCost')
icon_template: mdi-cash
which kinda works, in the regards that I now can check my configuration and restart my HA, which is helpful. It did also create attributes I can show in my entities-card, so I am ever closer to my goal. But, the value presented for the attribute in the card is simply: state_attr(‘sensor.real_time_consumption’, ‘accumulatedConsumption’) and state_attr(‘sensor.real_time_consumption’, ‘accumulatedCost’), which is not quite ideal. I’ll try to fix this now, but I’m always open for ideas since the experienced user probably can see the problem straight away