Action on summated values

I am trying to set up an action which will trigger based on the summated current power on two WEMO insight switches. I can return this summated power in the template editor using


However i am having trouble setting up a rule that will trigger on this value. What i currently have is:

- alias: 'high power usage' trigger: platform: numeric_state entity_id: switch.insight_1 value_template: '{{states.switch.insight_1.attributes.current_power_mwh+states.switch.insight_2.attributes.current_power_mwh}}' above: 2000 action: service: switch.turn_off entity_id: switch.insight_1
however this does not trigger. Can anyone help?

What is the value returned when you paste that template in the template dev tool in the frontend?

It says:

UndefinedError: 'dict object' has no attribute 'current_power_mwh'

Hi OMGA. Have you figured out how to manage the insight sum?

You should look at template sensors and templating to get started: