#Attribute "minor of" in automation

1 messages ยท Page 1 of 1 (latest)

cobalt orchid
#

platform: state
entity_id:

  • weather.forecast_casa
    attribute: humidity
    to: " 40"
    from: " 50"

Hi, I've the attribute: humidity and I would receive a notification when it is minor of 50 for example. In the graphic defition of the autonomation I've found only the possibility to set the change from a value to another (eg. from "50" to "40"). Could you please help me to set the condition < (minor of 50) in the above code ?
Thanks you so much

Giuseppe

worn haven
#

You need a numeric state trigger

tropic slate
#

I might be missing something, but you can use the keyword 'below' in the trigger of an automation. For example:

  - trigger: numeric_state
    entity_id:
      - sensor.temp1_humidity
    below: 50

This will only trigger the first time humidity drops below 50, not every time it is measured

bold summitBOT
#

To format your text as code, enter three backticks on the first line, press Enter for a new line, paste your code, press Enter again for another new line, and lastly three more backticks.
```yaml
example: here
```
Don't forget you can edit your post rather than repeatedly posting the same thing.

worn haven
#

Please use code markup ๐Ÿ˜‰

worn haven
cobalt orchid
#

Hi the first block works, the second give an error. Thank you for your support

worn haven
#

Because you pasted the wrong code into the block ๐Ÿ˜‰

#
trigger: numeric_state
entity_id:
  - sensor.temp1_humidity
below: 50
#

Replace the entire block with that

#

(and read the docs I linked)

tropic slate
#

If you're using the visual editor it might be easier to go back and when you add a trigger choose 'numeric state' rather than 'state'

cobalt orchid
#

@worn haven I appreciate your support but sorry I don't understand what I've to put

tropic slate
#

It should look something like this - you just need to choose the right entity and put 50 in the 'below' box

cobalt orchid
#

Thanks @tropic slate , now it seems correct both. I don't know if it works but the code seems ok. I've chosen the 'numeric state' rather than 'state' as you suggested ๐Ÿ™‚

worn haven
#

Remove the first trigger

#

It'll never work ๐Ÿ˜‰

cobalt orchid
#

ok @worn haven I've removed: thank you

cobalt orchid
#

platform: numeric_state
entity_id:

  • weather.forecast_casa
    attribute: humidity
    below: 50

platform: numeric_state
entity_id:

  • weather.forecast_casa
    attribute: humidity
    below: 50
#

Hi @worn haven , @tropic slate I've notice that the automation works but the attribute: humidity is not check as soon as I start HA. May I ask if there is way to do a attribute: humidity check at the HA startup ? thanks a lot , have a good day