Very basic newbee question about condition for action season

Hi, I have a condition set to ‘Season is spring’ Its spring now here (May 5 -Amsterdam, EU)
Bit still the test tells me its not right. See screenshot.

Also where is the time is x for? Also with that set to 1 second the tester gives the status ‘not passed’. I assume I can leave the timer empty?

Does the timer work like this: if set the 00:00:01 the 1 second after winter season changes to spring, then do your thing? Or does it work like this: under the condition that season is spring for at le4ast 1 second, do your thing?

Hope someone can help me.

If you’re using the season integration, you should leave the attribute field blank - “spring” is the state of sensor.season.

1 Like

Also make sure you have the correct type of season selected in your setup. From the docs:

For information on the difference between astronomical and meteorological seasons please see the link below:

2 Likes

Try using state for the condition rather than device. No idea if that is whats causing the issue or not, but it’s good practise.

hi thjanks for the quick reply entity/attribute/State, its all so confuzing.
But it pased when leaving the Attriburte empty (UX improval: show only the fields that are for this ‘Entity’)

Look at the Condition’s title in your first screenshot.

If Device class of Season is Spring

Look at the Condition’s title in your second screenshot.

If Season is Spring

It’s clear that the first one isn’t testing if the season is spring.

Virtually all entities have attributes so that’s why it appears as a field in the State Condition’s form.

Reference

State and State Object

Specifically- what do you want the automation to do? Details matter.

Yes, that’s how the for option works.

For example, if you set it to 10 seconds, the sensor’s value must be Spring for at least 10 seconds in order for the condition to be fulfilled.

It’s important to understand that the condition doesn’t wait for the sensor’s value. At the moment the condition checks the value it must already be Spring for at least 10 seconds.

@123 Thanks. And in your example: what happen if the condition time =10 seconds and it checks at 12 seconds. Then it also a ‘yes’? As I understand it, the timere is not a tricker but a condition for a tricker?

What I want to achieve:

  • when PV to network delevery to grid is above certain value and next hour also, then set nodon switch to ‘on’ for the PV smartgrid on my heat pump to make the boiler water 10 degrees celcius higher. ( I now set the start time at 12:00 and want to start 1 hour (3600 seconds) before highest forecast solar production
    • under certian conditions per season, slike sporing like currentpower is -1500 kW(delivery to grid) and forecast next hour is > 0,6 kWh
  • And another action to other way around…

the season=spring is now working, so I test further if the other restrictiions are not to strict.

Don’t post screenshots. Most here won’t read them.
Edit the automation in YAML, click on “copy to clipboard”, then paste that into the forum using code tags.

1 Like

Oké, Here it is. I simplified the tricker to just tricker on time. I tested spring condition witch is green, Oke. But still the action is not working.
Running the complete automation, it’s setting the device to on, do that’s working.

Any other errors a made?

The conditions are OR and not AND, i assume?


alias: v.02 Als PV overschot > verhoog buffer
description: >-
  Als PV vermogen meer dan waarde season voor huidige opwek en komend uur
  voorspelling, zet extra verwarming Wolf zoals ingesteld in Wolf smartset
triggers:
  - trigger: time
    at: "13:50:00"
conditions:
  - alias: If conbditiona match spring
    condition: and
    conditions:
      - condition: state
        entity_id: sensor.season
        state: spring
      - condition: numeric_state
        entity_id: sensor.energy_next_hour
        above: 0.6
      - condition: numeric_state
        entity_id: sensor.p1_meter_vermogen
        below: -1.5
  - alias: If conbditiona match summer
    condition: and
    conditions:
      - condition: numeric_state
        entity_id: sensor.energy_next_hour
        above: 1
      - condition: numeric_state
        entity_id: sensor.p1_meter_vermogen
        below: -3
      - condition: state
        entity_id: sensor.season
        state: Summer
  - alias: If conbditiona match Autumn
    condition: and
    conditions:
      - condition: numeric_state
        entity_id: sensor.energy_next_hour
        above: 0.6
      - condition: numeric_state
        entity_id: sensor.p1_meter_vermogen
        below: -1.5
      - condition: state
        entity_id: sensor.season
        state: Autumn
  - alias: If conbditiona match Winter
    condition: and
    conditions:
      - condition: numeric_state
        entity_id: sensor.energy_next_hour
        above: 0.6
      - condition: numeric_state
        entity_id: sensor.p1_meter_vermogen
        below: -1.5
      - condition: state
        entity_id: sensor.season
        state: Winter
actions:
  - type: turn_on
    device_id: 7a739ad799f54b2161410c7329af5c12
    entity_id: 35b896d51e92b58b34568ea90ab9d31d
    domain: light
    flash: long
  - action: notify.mobile_app_iphone_12_keesjan
    metadata: {}
    data:
      message: Wp warm water PV verhoging aan
      title: "HA boodschap "
mode: single

You assume incorrectly. Conditions are AND by default, unless you explicitly set them to OR.

What you currently have here will never cause your automation to perform the actions, because your conditions are checking whether the season is spring AND summer AND autumn AND winter.
You will need to use Choose in order to determine what numeric states it should validate, depending on the season.

You didn’t run the complete automation - you ran the action part by itself. That skips the entire trigger & condition section and only runs the action part - that’s why it worked.

1 Like

You need to Or those:

conditions:
  - condition: or
    conditions:
      - alias: If conditions match spring
        condition: and
        conditions:
          - condition: state
            entity_id: sensor.season
            state: spring
          - condition: numeric_state
            entity_id: sensor.energy_next_hour
            above: 0.6
          - condition: numeric_state
            entity_id: sensor.p1_meter_vermogen
            below: -1.5
      - alias: If conditions match summer
        condition: and
        conditions:
          - condition: numeric_state
            entity_id: sensor.energy_next_hour
            above: 1
          - condition: numeric_state
            entity_id: sensor.p1_meter_vermogen
            below: -3
          - condition: state
            entity_id: sensor.season
            state: Summer
      - alias: If conditions match Autumn
        condition: and
        conditions:
          - condition: numeric_state
            entity_id: sensor.energy_next_hour
            above: 0.6
          - condition: numeric_state
            entity_id: sensor.p1_meter_vermogen
            below: -1.5
          - condition: state
            entity_id: sensor.season
            state: Autumn
      - alias: If conditions match Winter
        condition: and
        conditions:
          - condition: numeric_state
            entity_id: sensor.energy_next_hour
            above: 0.6
          - condition: numeric_state
            entity_id: sensor.p1_meter_vermogen
            below: -1.5
          - condition: state
            entity_id: sensor.season
            state: Winter

That way, each block you have created with the And conditions can allow the action sequence to be executed.

1 Like

Thanks, for others to learn:
use the ‘add building block’ function in the visual editor to add OR conditions per (in my case) season.