Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 103602

Automation condition based on user action

$
0
0

Hy there!

I have an automation in HA to power ON and OFF a water heater using a sonoff s26r2 wifi switch trigger by a state and attribute condition value provided by a solar inverter (huawei sun2000l) integration.
All good, but for the power OFF automation i want to include a new condition like a “manual” scenario when a user of ha manual turn ON the switch, so automation should return false and not power off the s26r2.

In the logbook of s26r2 i see the message “Turned on by Valentin” if i manual power on the switch but how can i put this in the automation.

The actual yaml code is this. How can i integrate the user condition?

alias: PowerOff_Sun2000_WaterHeater_2kw
description: PowerOff
trigger:
  - platform: state
    entity_id: sensor.sun2000l_3ktl_2101073801hvk7000432
condition:
  - condition: device
    type: is_on
    device_id: 4341c747aa1369bd67c938050b434495
    entity_id: switch.sonoff_100144c2ff
    domain: switch
  - condition: or
    conditions:
      - condition: numeric_state
        entity_id: sensor.sun2000l_3ktl_2101073801hvk7000432
        attribute: power
        below: '-100'
      - condition: numeric_state
        entity_id: sensor.sun2000l_3ktl_2101073801hvk7000432
        attribute: power_meter_active_power
        above: '1500'
action:
  - type: turn_off
    device_id: 4341c747aa1369bd67c938050b434495
    entity_id: switch.sonoff_100144c2ff
    domain: switch
mode: single

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 103602

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>