Preparing for a Dynamic Energy Contract with Color Awareness

Hi everyone,

I’ll soon be switching to a dynamic energy contract where electricity prices vary by the hour. To help my family become more aware of this, I’ve created a simple automation that displays energy prices using five colors:

  • Green: When the price is below €0.20/kWh or when our solar panels returning more than 500 Watts to the grid.
  • Blue, Yellow, Purple, and Red: Indicating progressively higher prices, with red representing the most expensive rates.

This setup has sparked some great dinner table conversations about energy usage and costs.

It’s a fun and engaging way to raise awareness about dynamic energy pricing, and it’s helping us get ready to make smarter energy decisions.

Feel free to ask if you’d like more details about how I set this up!

Best regards,
Henry van der Heide

The automation code I used below. the reason i use scenes for the lamp colors is due to the lamp is form Tuya and this the only way is to adress them. In the Tuya app I created the scenes. To get the dynamic prices I used this blog

alias: Aanpassen lampkleur op stroomprijs (5 apparaten)
description: “”
triggers:

  • entity_id: sensor.dynamische_prijzen_current_electricity_market_price
    trigger: state
  • entity_id: sensor.dsmr_reading_electricity_currently_returned
    trigger: state
    conditions:
    actions:
  • target:
    entity_id: >
    {% set teruglevering =
    states(‘sensor.dsmr_reading_electricity_currently_returned’) | float %}
    {% if teruglevering > 0.500%}
    scene.green
    {% else %}
    {% set price = states(‘sensor.dynamische_prijzen_current_electricity_market_price’) | float %}
    {% if price < 0.20 %}
    scene.green
    {% elif price < 0.29 %}
    scene.blue
    {% elif price < 0.34 %}
    scene.yellow
    {% elif price < 0.39 %}
    scene.purple
    {% else %}
    scene.red
    {% endif %}
    {% endif %}
    action: scene.turn_on
    mode: single

Usually in share your projects, you share something that others can use. There is no code here…

Hi, thanks for your tip, I added the code