Automations created but not performed

Hello everyone . I created some automations that by running the test test . Unfortunately, I do not understand why they are not tried or better executed.

I’m at my first experiences with HA, but I just can’t get these automations started. I am attaching an example of yaml code .

alias: Frigo on
description: ""
trigger:
  - platform: numeric_state
    entity_id:
      - sensor.tensione_batterie
    for:
      hours: 0
      minutes: 3
      seconds: 0
    above: 48
    below: 60
condition: []
action:
  - service: switch.turn_on
    target:
      device_id: 9782c02d87263cb8f692ccc2784120bd
    data: {}
mode: single

This automation will only run when your

sensor.tensione_batterie

moves from lower then 48 to higher then 48, or from higher then 60 to below 60. If your sensor is anywhere between 48 en 60 it will not run.

Thank you , here is the status of my current sensor :slight_smile:


But it doesn’t go!

It won’t go until it goes below 48 or above 60 and then moves somewhere between 48 en 60 again.

Forgive me, then in my yaml file that I posted, to indicate to HA that the fridge must be activated in this range from 48 to 60 as a value what do I have to change in the yaml file? Sorry but the automations incredibly confuse me!

The automation is correct, but since your battery is already between 48 and 60, it won’t trigger. It will only trigger until it goes below 48 or above 60 and then moves somewhere between 48 en 60 again.

Thank you for your patience, but as a new user of ha I mean automation like this :slight_smile:

If the battery value is in the state 50.21 and the trigger indicates between 48 volts and 60 volts , the value 50.21 is in the range indicated by me so it must perform the action . I still don’t understand why the action of turning on the switch must take place below or above 60 volts. It seems like a rule on the contrary . Forgive me but I’m at my first experiences, but as a user I interpret it like this!

Also, if it is as you say, simply modify the values of the automation I posted so that it works and makes me understand the mechanism. At the moment I have 50.20 volts and I would expect it to turn on.

If you don’t understand then I suggest you read the documentation for the Numeric State Trigger.

It clearly explains that it triggers when the entity’s value crosses the threshold value.

Thank you for your patience it seems like a simple concept but instead I get a headache! :smile:

Simply wait until your battery drops below 48, you will see when it raises again the automation will kick in.

Thank you . I have to do some tests to understand. Now I have tried to understand if the action works to indicate to the automation if a PC is active then turn on the fridge if you turn it off turn it off. It works .

Hi , so if I understood correctly before the automation trigger is triggered , specific conditions must be verified that go beyond the declared values .


Alias: frigo on

Description: ""

Trigger:

- platform: numeric_state

Entity_id:

- sensor.voltage_batteries

Below: 49.8

Above: 48.3

For:

Hours: 0

Minutes: 10

Seconds: 0

Condition: []

Action:

- service: switch.turn_on

Metadata: {}

Data: {}

Target:

Device_id: 9782c02d87263cb8f692ccc2784120bd

Mode: single

In this case I expect that the fridge automation starting for example that the fridge is with a battery reading tenone at 47.90, it will cross 48.3 and as soon as it exceeds the values of 49.8 it will be activated.

Instead :smile:


Alias: Fridge off

Description: ""

Trigger:

- platform: numeric_state

Entity_id:

- sensor.voltage_batteries

Below: 50

Above: 48.15

For:

Hours: 0

Minutes: 10

Seconds: 0

Condition: []

Action:

- service: switch.turn_off

Target:

Device_id:

- 9782c02d87263cb8f692ccc2784120bd

Data: {}

Mode: single

Instead in this automation having previously exceeded the values of 49.8 and going down a little less than 48.15 it will turn off.

Did I get it right?