I’m working on my automated irrigation system. I’m trying to calculate 2 sensors :
rain probability (based on forecast)
irrigate (yes / no) based on a simple calculation (could be more complex in the future).
I’m quite new with HA, YAML and all this environment, so, I’m sure my mistakes are quite dumb.
My problem all of my 2 sensors are unavailable.
When it works, I would in an ideal world, calculate the first sensor (probability) on specific time of the day. And the second one (irrigate) on update on the first sensor.
I’m struggling as well to test it and to be sure all my changes are correctly taken in account. Thanks for your help. My code below (package yaml).
That delay was just for testing purpose, but you right there is absolutely no value to check that every minutes. I want for the productive version to change that to a time trigger which fires at 00:01, 18h01 only. I will irrigate during evening or night, so, I have accurate prevision value.
I don’t solve it yet the issue, but I think I pointed the problem and need your help.
The code above is in a dedicated file, a package. I include this file in the initial configuration.yaml. It was working with only one template but not 2.
# Include custom packages
homeassistant:
packages: !include_dir_named packages
I’m still struggling on how I need to split things. I liked the idea to have all my template / sensor in a dedicated file.
Packages should be configured exactly as you have it in Post #5.
Only your first sensor is showing up because the binary sensor configuration has a few issues:
The configuration is using the incorrect configuration key value_template, the proper key is state
There doesn’t appear to be a reason for it to be trigger-based. Removing the trigger will allow it to update whenever the forecast sensor or threshold number input are updated.
The entity IDs need to be slugs… Hyphens are not an allowed character in entity ID’s they should be replaced with underscores.
If you are not going to provide defaults for your float filters you should definitely set up an availability template.