Need some help in Automaton

Good day everybody,
I’m still fairly new to HA and even more so to automation.

I set up a small PV system here and finally got Homeassistant running after a long time.

I have a monitoring system for the inverter and the BMS, I have my entities in HA and now I want to control something.

At the moment it’s about the hot water boiler. But somehow I can’t get the automation to work. I want the heating to be switched on, in my case a shelly which then enables the heating control

I would like to query when a certain charge level of the battery has been reached and then switch on the Shelly, but only if there is enough Pv1 and PV2 power. The temperature control is still external, I’m not that far along yet.
I did the automation with the editor but it doesn’t trigger.
Please what am I doing wrong or how can it be better or right

I’m also attaching the automation I created. I don’t know a wheel. At the moment I switch on the Shelly manually every day

thanks in advance
Shell-soc-on

alias: SOC->xx%-0800-1800uhr EIN
description: ""
trigger:
  - platform: numeric_state
    entity_id:
      - sensor.jk_bms_state_of_charge
    above: 44.9
condition:
  - condition: time
    after: "08:00:00"
    before: "18:00:00"
    weekday:
      - mon
      - tue
      - wed
      - thu
      - fri
      - sat
      - sun
  - condition: numeric_state
    entity_id: sensor.ss_pv2_power
    above: 800
  - condition: numeric_state
    entity_id: sensor.ss_pv1_power
    above: 800
action:
  - service: switch.turn_on
    metadata: {}
    data: {}
    target:
      area_id: pv
      device_id: 3f692e8e19bd691b9a0dd3a287f1118d
      entity_id: switch.shellyplus1_d8132ad3b278_switch_0
mode: single

More something like this:

alias: SOC->xx%-0800-1800uhr EIN
description: ""
trigger:
  - platform: numeric_state
    entity_id:
      - sensor.jk_bms_state_of_charge
    above: 44.9
  - platform: numeric_state
    entity_id: sensor.ss_pv2_power
    above: 800
  - platform: numeric_state
    entity_id: sensor.ss_pv1_power
    above: 800
  - at: '8:00:00'
    platform: time 
condition:
  - condition: time
    after: "08:00:00"
    before: "18:00:00"
    weekday:
      - mon
      - tue
      - wed
      - thu
      - fri
      - sat
      - sun
  - condition: numeric_state
    entity_id: sensor.jk_bms_state_of_charge
    above: 44.9
  - condition: numeric_state
    entity_id: sensor.ss_pv2_power
    above: 800
  - condition: numeric_state
    entity_id: sensor.ss_pv1_power
    above: 800
action:
  - service: switch.turn_on
    metadata: {}
    data: {}
    target:
      area_id: pv
      device_id: 3f692e8e19bd691b9a0dd3a287f1118d
      entity_id: switch.shellyplus1_d8132ad3b278_switch_0
mode: single

Thanks for the message, does that mean in the future that I have to set each trigger as an additional condition?

i.e. if I query the temperature to see if it is below the value, do I have to set the trigger and condition?

thank you verry much

That’s one way, but you can also use filters to find them if you either name them similarly to find, use labels or use categories.

  • If it is 8:00, and jk_bms_state_of_charge is already above 44.9, and both ss_pv2_power and ss_pv1_power are already above 800, your shelly will turn on

  • if your jk_bms_state_of_charge reaches 50, and both ss_pv2_power and ss_pv1_power are already above 800, your shelly will turn on, and it is after 8, your shelly will turn on

  • if ss_pv2_power reaches 800, and jk_bms_state_of_charge is already above 44.9, and ss_pv1_power is already above 800, and it is after 8, your shelly will turn on

  • if ss_pv1_power reaches 800, and jk_bms_state_of_charge is already above 44.9, and ss_pv2_power is already above 800, and it is after 8, your shelly will turn on

So yes, triggering on each condition is how I do it.

The ‘if’ are triggers, the ‘and’ are conditions.

I tried your suggestion. This works as long as the values ​​are not above the trigger threshold. If they are above it, only time is used as a trigger. So I would have to build a query that starts a query every minute in order to check the values, but if I now have 4 variants I have 4 clocks that send a query every minute, so the PI4 will quickly reach its limits.
I’m a bit spoiled by the Siemens logo :slight_smile:

Correct. This is exactly what you asked for:

Why?

The Shelly is on in the time window if the power & SoC meets your requirements, like you asked for.

Or are you asking for additional automation to turn the Shelly off?