Setting a condition using an entity's history

I would like to use rain data as a condition for automating a watering valve. The entity I would like to use is “daily rain”. I want to have an automation that turns on the watering valve unless the value of “daily rain” over 2 or 3 days exceeds a specified amount (eg 1). Is there a way to use the history of “daily rain” to do this?

Can’t help with your exact problem, but have you taken a look at these irrigation integrations, especially this one:

Good idea. I’ll look at your link and check out some others.

You can define a new entity based on your rain entity using the statistics integration:

Maybe you can help me with my sensor setup. I am receiving an error when I check configuration.yaml.

Invalid config for [sensor]: required key not provided @ data[‘platform’]. Got None. (See /home/homeassistant/homeassistant/configuration.yaml, line 47).

Line 47 is “sensor:”.


sensor:
  -platform: statistics
   name:"Two day rain total"
   entity_id:sensor.meteobridge_precipitation_today
   state_characteristic:total
   sampling_size:2

Wrong indentation and/or whitespace between platform and hyphen:

- platform: statistics <= whitespace between

Can’t say if the lines beneath have to be indented more or less, but try it first with the extra whitespace between the hyphen and the platform.

1 Like

That did it. Thanks!

1 Like