Using a Custom Sensor in an Automation

Hi there,

i started with ha a few months ago and have been a fan since then.

Unfortunately, I am not able to implement my current project.

I would like to switch on different devices when I have solar power available. I bought a Shelly EM3 for this. Unfortunately, the overall power is not displayed in HA but all 3 phases are separated. In the forum I found a snippet of code to create a custom sensor that shows me all 3 phases commutated. Unfortunately I cannot use the custom sensor as a trigger. I also read the linked article, but Iā€™m still too inexperienced to understand. Could a template solve my problem?

I would be very grateful for a tip.

Yes you can.

Instead of a device trigger, use a numeric state trigger. e.g.

  trigger:
    platform: numeric_state
    entity_id: sensor.three_phase_power # or whatever yours is called
    above: 5000
    for:
      minutes: 10
1 Like

wow, searched for hours :frowning:

Thank you so much.

Works like a charm! :slight_smile: