Electricity price and usage costs - OpenEPaperLink/Home_Assistant_Integration GitHub Wiki
This shows price, cost and electricity usage:
What you need:
- Nordpool (or other source of electricity prices)
- A sensor that contains electricity usage so far today, read from the meter (e.g HAN-port)
- A sensor that contains electricity costs so far today
- A sensor that contains electricity usage so far this month
Automation:
trigger:
- platform: time_pattern
minutes: "1"
condition:
- condition: time
after: "06:00:00"
before: "23:00:00"
action:
- service: open_epaper_link.drawcustom
target:
entity_id: open_epaper_link.00000123456789
data:
background: white
dry-run: false
ttl: 60
rotate: 0
payload:
- type: line
fill: red
width: 3
x_start: 148
y_start: 0
x_end: 148
y_end: 110
- type: line
fill: red
width: 2
x_start: 0
y_start: 109
x_end: 296
y_end: 109
- type: text
value: "So far today:"
font: ppb.ttf
x: 74
"y": 20
size: 20
color: black
anchor: mm
- type: text
value: "{{ states('sensor.energy_today_cost') | round(0) }} kr"
font: ppb.ttf
x: 74
"y": 58
size: 38
color: >-
{{'black' if states('sensor.energy_today_cost') | round(0) | int <=
50 else 'red' }}
anchor: mm
- type: text
value: "{{ states('sensor.energy_today_kwh') | round(0) }} kWh"
font: ppb.ttf
x: 74
"y": 90
size: 20
color: >-
{{'black' if states('sensor.energy_today_kwh') | round(0) | int <=
100 else 'red' }}
anchor: mm
- type: text
value: "{{ states('sensor.nordpool') | round(0) }}"
font: ppb.ttf
x: 224
"y": 33
size: 50
color: >-
{{'black' if state_attr('sensor.nordpool', 'low_price') == true else
'red' }}
anchor: mm
- type: text
value: øre/kWh
font: ppb.ttf
x: 225
"y": 65
size: 18
color: black
anchor: mm
- type: icon
value: arrow-down
x: 150
"y": 83
size: 20
color: black
- type: text
value: "{{ state_attr('sensor.nordpool', 'min') | round(0) }}"
font: ppb.ttf
x: 170
"y": 93
size: 22
color: >-
{{'black' if state_attr('sensor.nordpool', 'min') | int <= 150 else
'red' }}
anchor: lm
- type: text
value: "{{ state_attr('sensor.nordpool', 'max') | round(0) }}"
font: ppb.ttf
x: 277
"y": 93
size: 22
color: >-
{{'black' if state_attr('sensor.nordpool', 'max') | int <= 150 else
'red' }}
anchor: rm
- type: icon
value: arrow-up
x: 277
"y": 83
size: 20
color: black
- type: text
value: >-
Est. so far this month: {{ states('sensor.energy_month_cost') |
round(0) }} kr
font: ppb.ttf
x: 3
"y": 120
size: 12
color: black
anchor: lm
- type: text
value: "At: {{ now() | as_timestamp() | timestamp_custom('%H:%M')}}"
font: ppb.ttf
x: 235
"y": 120
size: 12
color: black
anchor: lm
mode: single
Notes:
- All numbers are rounded to not show decimals. If you want to show decimals, please change the "round(0)" to your liking.
- The time format for last update is "HH:MM". To change this, replace
timestamp_custom('%H:%M')
with different format - Please do a search&replace for all occurences of the default sensors with your own sensors
- Take a look at the "color"-settings of the numbers and update the value you consider to be "high", which is uses to show the numbers in red color