Closed bsmith76s closed 2 years ago
Let's unpack this.
The adjustment is being set to 0% which in turn will make the duration 0. If you believe the adjustment is not correct then take the last part of the automation from the line below percentage: >
and paste into Developer Tools -> TEMPLATE. This will allow you to work through the calculations. The calculations on my system yield 0 because it has been raining a lot recently.
{# Threshold variables #}
{% set rain_total_threshold = 3.5 %}
{% set rain_rate_threshold = 1.0 %}
{% set temperature_threshold = 20.0 %}
{# Sensor data #}
{% set rain_total = states('sensor.irrigation_unlimited_rain_weighted_total') | float(-1) %}
{% set rain_rate = states('sensor.wupws_preciprate') | float(-1) %}
{% set temperature_average = states('sensor.irrigation_unlimited_temperature_5_day_moving_average') | float(-273) %}
{# Threshold variables #}
{% set rain_multiplier = (1 - (rain_total / rain_total_threshold)) %}
{% set temperature_multiplier = temperature_average / temperature_threshold %}
{% set multiplier = 1.0 %}
{% if rain_rate < rain_rate_threshold and rain_multiplier > 0 and rain_total < rain_total_threshold %}
{% set multiplier = multiplier * temperature_multiplier %}
{% set multiplier = multiplier * rain_multiplier %}
{% else %}
{% set multiplier = 0.0 %} {# It's raining or enough already #}
{% endif %}
{# Return multiplier as a percentage #}
{{ (multiplier * 100) | round(0) }}
Because the adjustment is 0 there really is no future schedule. In the past it would show the next event even though it had a zero duration. This is actually not correct and misleading as nothing will happen. The code was altered to show the next event that has a duration > 0 and activate something. In this situation there is no future event.
At the moment you are adjusting all of the zones which is fine. There are other options to adjust sequences or sequence zones. No right or wrong just flexibility.
Thanks for explaining how the new way of calculating the adjustment works and code shows the next cycle event. I will not close this until it stops raining and I see it is working correctly.
Also does the irrigation_unlimited_smart_irrigation.yaml only need added to packages folder if using jeroenterheerdt/HAsmartirrigation automation? Also do I just set the entitiy_id to the main control to do all zones or do I add zones: 0 to irrigation_unlimited_smart_irrigation.yaml like in my irrigation_unlimited_adjustment.yaml?
Sorry for all the questions but I am trying to wrap my head around this. Last year I think I used the HAsmartirrigation automation but I am unsure. I have changed so many things in Home Assistant over last year I just don't recall. This integration is great and thank you for all your work on it and help.
You only need irrigation_unlimited_smart_irrigation.yaml if using HAsmartirrigation. It was recently updated to check it was installed and configured, caused problems otherwise.
There are two basic areas; zones and sequences.
Zones
The entity_id:
can either be the zone i.e. ...c1_z1
or the controller ...c1_m
along with the zones:
parameter. It doesn't matter which as it all ends up at the same place. The zones parameter can be 0 in which it just loops through all the zones. Can also be a list like [1,3,5].
Sequences
The entity_id:
must be the controller. Leave the zones parameter out and use the sequence_id:
parameter.
For an in-depth dive there is a section in the documentation at service call access roadmap
Hope this helps.
Everything seems to be working good now. I have adjusted some of the values in the adjustment.yaml for better need in my garden. thank you again for your help.
I did not want to open another issue because I have a question about the adjustment.yaml. I could not find a way to send you a message. in the adjustment.yaml in the automation section there are 3 way to trigger. you mention comment and uncomment as needed.
automation:
- id: 'IU1653340123453'
alias: Irrigation Unlimited Adjustment
trigger:
# -------------------------------------------------------------------
# Choose how you want to trigger this automation.
# Comment out/delete/change as required.
# -------------------------------------------------------------------
# Run at a fixed time
- platform: time
at: "02:00"
# Run when Home Assistant starts
- platform: homeassistant
event: start
# Run when the sensors update. Don't use this option if any of your
# schedules use the 'anchor: finish'. It will most likely cause the
# system to skip. Use a fixed time.
- platform: state
entity_id:
- sensor.irrigation_unlimited_rain_weighted_total
- sensor.irrigation_unlimited_temperature_5_day_moving_average
- sensor.wupws_preciprate
can you use more than 1 trigger or is only 1 trigger is allowed? I have all uncommented at the moment but the adjustment does not seem to change unless I restart Home Assistant then the adjustment is calculated. I would like to just use when sensors update and at a certain time. Any help would be great. Thank you.
You can have multiple triggers. At the moment the automation will trigger on HA startup, at 02:00 or when any of the three entities listed change state. For just time and sensor update then comment out the HA startup bit. Does the automation not trigger or does the adjustment not appear?
automation:
- id: 'IU1653340123453'
alias: Irrigation Unlimited Adjustment
trigger:
# -------------------------------------------------------------------
# Choose how you want to trigger this automation.
# Comment out/delete/change as required.
# -------------------------------------------------------------------
# Run at a fixed time
- platform: time
at: "02:00"
# Run when Home Assistant starts
# - platform: homeassistant
# event: start
# Run when the sensors update. Don't use this option if any of your
# schedules use the 'anchor: finish'. It will most likely cause the
# system to skip. Use a fixed time.
- platform: state
entity_id:
- sensor.irrigation_unlimited_rain_weighted_total
- sensor.irrigation_unlimited_temperature_5_day_moving_average
- sensor.wupws_preciprate
The adjustment is showing but has been at 42% for days have not had any rain for over a week so I would think it would be back to 100%.
If you haven't already, turn on debug logging. Add this to the configuration and restart.
logger:
default: info
logs:
custom_components.irrigation_unlimited: debug
Go to Settings -> System -> Logs -> LOAD FULL LOG. Put in 'irrigation_unlimited' into the 'search logs' box. You should see all the key information and service calls. For example:
2022-07-22 16:15:35 DEBUG (MainThread) [custom_components.irrigation_unlimited] CALL [2022-07-22 16:15:35] service: adjust_time, controller: 1, zone: 8, data: {"entity_id": "binary_sensor.irrigation_unlimited_c1_z8", "actual": "13:38:19"}
If you know your way around linux then try grep custom_components.irrigation_unlimited home-assistant.log
. Install terminal in Settings -> Add-ons -> Terminal & SSH is pretty handy.
If you are not seeing these CALL messages then the automation is not working. If you do see them please post them here.
here are 2 CALL's that happened during a rain event
2022-07-25 10:30:09 DEBUG (MainThread) [custom_components.irrigation_unlimited] CALL [2022-07-25 10:29:00] service: adjust_time, controller: 1, zone: 0, data: {"entity_id": "binary_sensor.irrigation_unlimited_c1_m", "zones": [0], "percentage": 22.0}
2022-07-25 11:33:00 DEBUG (MainThread) [custom_components.irrigation_unlimited] CALL [2022-07-25 11:32:00] service: adjust_time, controller: 1, zone: 0, data: {"entity_id": "binary_sensor.irrigation_unlimited_c1_m", "zones": [0], "percentage": 0.0}
there is no CALL for the platform time for 2 days. it should show a CALL at 3:00AM but for last 2 days thelog shows nothing. After a home assistant restart debug logger shows the CALL to the adjustment. here is the CALL after restart
2022-07-26 12:29:44 DEBUG (MainThread) [custom_components.irrigation_unlimited] CALL [2022-07-26 12:29:00] service: adjust_time, controller: 1, zone: 0, data: {"entity_id": "binary_sensor.irrigation_unlimited_c1_m", "zones": [0], "percentage": 24.0}
do you think the double quotes around the desired time for platform in the adjustment.yaml should be single quotes? I changed the desired time to single quotes and will see if this makes a difference tomorrow.
That's what I would expect. The adjustment went from 22% to 0 at the start of the rain event. Duplicate calls are ignored so setting the same adjustment will not be recorded. Some sensors update every 30 seconds even though the information has not changed. In these cases the call is just let go through to the keeper. You can still see if the automation fired from Settings -> Automations and click on 'Debug automation'.
You can use single or double quotes, no difference.
Assume all is working ok now.
I have deleted and reloaded the integration multiple times. I've tried to only use the bare minimum configuration and it will not calculate the next cycle. here is a link to pic showing the next cycle not being calculated. This all worked last year and worked up until 2 days ago.
https://imgur.com/a/IkIITsK
Version of the custom_component
I have tried 2022.6 and the master -->
Configuration
Add your logs here.
Add your logs here.