How to change light color depending on emoncms available solar power


I’m struggling with the yaml to dynamically control three shelly color bulbs color depending on emoncms solar power production.

My Idea is to represent in various areas of my home (where devices with strong power consumption are) the current power production available from the photovoltaic panels, so that we can do more informed decisions on which appliances to use and when (ex. respond to the question: is this a good time to start the dishwasher?, and if I start the dishwasher I’d like the color of the bulb to reflect that, so I can evaluate wether to start something else as well)

I’m not sure how to deal with this, I tried with automation, but can’t get the light to change color at all.

Here’s my current yaml:

alias: solar
description: Solar available
  - platform: numeric_state
    entity_id: sensor.emoncms2_solar
    above: 100
  - service: light.turn_on
    entity_id: light.shellycolorbulb_3494546b5b7d
      brightness: 175
      rgb_color: [255, 0, 0]
mode: restart

Ideally I’d like:

  • the bulbs to change color continuously (i.e. always showing current production)
  • the color to match current power availability (red no export or negative export, green lots of export, yellow a bit of export)
  • the color should change in a continuous way (ex. little less export is shown as little more red, little more production, little more yellow or green)
  • The intensity of light should be correlated to total solar production (no production very dim, lots of production very bright)

When I run the yaml automation above nothing happens, I’m not sure what’s going on or how to debug it.

any suggestions?


1 Like

any luck? Im also keen to know