jeroenterheerdt / HAsmartirrigation

Smart Irrigation custom component for Home Assistant
MIT License
301 stars 47 forks source link

Sensor group weather/sensor data is applied to one zone then deleted when other zones can depend on the data #325

Closed jata1 closed 1 month ago

jata1 commented 3 months ago

What happened?

I have 2 zones setup with one sensor group. When I manually update/calculate a zone the sensor data is deleted and is not available for other zones that depend on the same sensor data.

How to reproduce

  1. create 2 zones (zone 1 and zone 2) and link both to the same sensor group.
  2. wait until sensor group data is collected then apply/calculate for zone 1 using the zone specific buttons in the GUI
  3. note now that the data is deleted and is not available to calculate watering for zone 2

Relevant log output

No response

Which version are you running?

v2023.12.2

Diagnostics file

Additional information

Not sure what happens if I click the 'calculate all zones' button instead of the calculation for each zone separately.

diagnostic file attached...

config_entry-smart_irrigation-7f7127f4c22a04d1cbd475295c54538c.json.txt

jata1 commented 3 months ago

as requested @jeroenterheerdt.

To be clear what i mean by apply/calculate for a zone, see screen shot below.

image

jeroenterheerdt commented 3 months ago

ah, that is by design. If you use the 'calculate all' button or service it should work, as in: we make sure to calculate everything only once / use the same weatherdata many times over. If you press the button you highlighted then yes, the weather data is deleted.

jata1 commented 3 months ago

haha. That explains why I have been going mad for the last week when one zone calculated fine and the other did nothing.

I think you need to add a note to explain this (or a warning) to say to use the calculate all zones

jata1 commented 3 months ago

I need to check what my automations are doing as I could have something that calculates for a specific zone and I assume this will also delete the data

jeroenterheerdt commented 3 months ago

haha. That explains why I have been going mad for the last week when one zone calculated fine and the other did nothing.

I think you need to add a note to explain this (or a warning) to say to use the calculate all zones

that's fair. The UI is just for debugging. We expect users to just use the calculate all service.

jeroenterheerdt commented 3 months ago

I need to check what my automations are doing as I could have something that calculates for a specific zone and I assume this will also delete the data

correct.

jata1 commented 3 months ago

haha. That explains why I have been going mad for the last week when one zone calculated fine and the other did nothing. I think you need to add a note to explain this (or a warning) to say to use the calculate all zones

that's fair. The UI is just for debugging. We expect users to just use the calculate all service.

well I guess I am an unexpected user lol

image

jata1 commented 3 months ago

the above is fired when my tap/value stops watering. This was also not working properly until I created a duplicate sensor group.

I wanted this to work like this so I get an estimate of how much more watering a zone 'needs' when the valve turns off. This is so I can manually water and still know how much water is needed

jeroenterheerdt commented 3 months ago

haha. That explains why I have been going mad for the last week when one zone calculated fine and the other did nothing. I think you need to add a note to explain this (or a warning) to say to use the calculate all zones

that's fair. The UI is just for debugging. We expect users to just use the calculate all service.

I have updated the readme to clarify it.

jeroenterheerdt commented 3 months ago

the above is fired when my tap/value stops watering. This was also not working properly until I created a duplicate sensor group.

I wanted this to work like this so I get an estimate of how much more watering a zone 'needs' when the valve turns off. This is so I can manually water and still know how much water is needed

you can then just calculate all zones, right? you'd still have the data you need to manually water?

jata1 commented 3 months ago

the above is fired when my tap/value stops watering. This was also not working properly until I created a duplicate sensor group. I wanted this to work like this so I get an estimate of how much more watering a zone 'needs' when the valve turns off. This is so I can manually water and still know how much water is needed

you can then just calculate all zones, right? you'd still have the data you need to manually water?

yep. just need to change the two automations/scripts to calculate all zones.

jata1 commented 3 months ago

Overall I think it would be cleaner/better to be able to do the things I wanted for each zone but I get it will be tricky as you'll need to hold sets of calculated data for each zone that is using a sensor group.

Good that you have clarified in the readme / documentation

jeroenterheerdt commented 3 months ago

Yeah, I don't want to keep copies of the data around and it can grow really large very quickly. I mean, I could potentially create a parameter to the calculate services to control deletion after calculating that defaults to true. That would not break existing users but provide flexibility for you, right?

github-actions[bot] commented 1 month ago

Stale issue message