Hi,
Looking for some help with getting an automation working. Fairly new to HA and very new to automation - this is my first.
I am trying to get a plug to switch on when the grid power in the house goes below a certain value and turn off agin when it goes above a different higher value. The ultimate goal is to make certain sockets turn on when the solar array is generating a lot of energy and off when it isn’t. However it’s dark while I try to do this so simulating with much higher values and turning electrical devices on or off to get the grid power to pass above and below a fixed value. I can get the automation to work using a time trigger but not a numeric state trigger so any help would be greatly appreciated.
I used the automations UI to do add the two automations for on and off and below is what it put in my automations.yaml
- id: '1669239228833'
alias: Excess Solar On
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.grid_power
attribute: ''
below: '600'
condition:
- condition: device
type: is_off
device_id: 015443524065e6186d76671b7f51bd08
entity_id: switch.tapo_1
domain: switch
action:
- type: turn_on
device_id: 015443524065e6186d76671b7f51bd08
entity_id: switch.tapo_1
domain: switch
mode: single
- id: '1669239668783'
alias: Excess Solar Off
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.grid_power
above: '600'
condition:
- condition: device
type: is_on
device_id: 015443524065e6186d76671b7f51bd08
entity_id: switch.tapo_1
domain: switch
action:
- type: turn_off
device_id: 015443524065e6186d76671b7f51bd08
entity_id: switch.tapo_1
domain: switch
mode: single
Thanks for any help you can provide with this. Hopefully I have just misunderstood how this works and it’s easy to fix.