Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I do not see the "enable program" button in the card #117

Open
fnorrmann opened this issue Jan 17, 2025 · 9 comments
Open

I do not see the "enable program" button in the card #117

fnorrmann opened this issue Jan 17, 2025 · 9 comments

Comments

@fnorrmann
Copy link

Hi, I have setup the basic 3 zone demo and I cannot see the "enable program" button in the lovelace card, how can I enable it?

Image

Cheers,

@petergridge
Copy link
Owner

It looks like you have the show program option on the card configuration unticked

@petergridge
Copy link
Owner

Image

@petergridge
Copy link
Owner

However it is odd that the start time is displayed. Are you using the custom card or the generated yaml?

@kwithus
Copy link
Contributor

kwithus commented Jan 22, 2025

I do have the same issue, every time I restart HA.
The integration fails to setup the switches correctly, all switches are not available, resulting in the above mentioned error.
I do have to re-load the integration, which then brings up the switches and everything looks good again.
I assume that the error logs (see below) are related.

The related switch (rasesnprenger_links) is set up by another integration (HomematicIP local) which probably does start only after the irrigation integration, or maybe simultaneously, but does take longer, as it takes a while to start this integration with quite a lot of devices.
So when the irrigation integration tries to setup this switch, it gets the error, as the underlying switch is not available and stops to setup any switch at all.
Hope this does help you to address this issue

regards
Karl

Dieser Fehler stammt von einer benutzerdefinierten Integration

Logger: custom_components.irrigationprogram.switch
Quelle: custom_components/irrigationprogram/switch.py:57
Integration: Irrigation controller (Dokumentation, Probleme)
Erstmals aufgetreten: 11:59:06 (1 Vorkommnisse)
Zuletzt protokolliert: 11:59:06

Switch switch.rasensprenger_links has not initialised before irrigation program

Logger: homeassistant.components.switch
Quelle: helpers/entity_platform.py:366
Integration: Schalter (Dokumentation, Probleme)
Erstmals aufgetreten: 11:59:06 (1 Vorkommnisse)
Zuletzt protokolliert: 11:59:06

Error while setting up irrigationprogram platform for switch
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 366, in _async_setup_platform
await asyncio.shield(awaitable)
File "/config/custom_components/irrigationprogram/switch.py", line 73, in async_setup_entry
switch = Zone(unique_id, name,z_name,friendly_name, zone,data.program)
^^^^^^^^^^^^^
UnboundLocalError: cannot access local variable 'friendly_name' where it is not associated with a value

@petergridge
Copy link
Owner

petergridge commented Jan 24, 2025

Hi Karl,

Are you comfortable modifying the code? In the config\custom_components\irrigationprogram directory you will see a const.py file.

If you change the ‎CONST_LATENCY value from 5 to something that is longer than it takes to set up the switches on load, it should fix your issue. Let me know if that helps and I will look at adding this as an advanced configuration settings.

You may also be able to automate a reload, when your other apps have started.

Pete

@kwithus
Copy link
Contributor

kwithus commented Jan 24, 2025

Hi, will try that later today (hopefully today ;-) )

@kwithus
Copy link
Contributor

kwithus commented Jan 24, 2025

Ok, I increased the latency step by step. At 25 sec. It was long enough for all three configured progs to load. As I said before the other integration needs a while to load all devices (>150).
Can you increase the latency by default or is that too long for other users? If it’s too long I will need to find a way to reload the integration through an automation after every restart.

@petergridge
Copy link
Owner

I can handle this. It's not a delay as such it is a retry loop so it won't impact other users. I will need to create a new variable as this one is used for other delays as well.

@kwithus
Copy link
Contributor

kwithus commented Jan 25, 2025

Great! Thx.
BTW, would it be able to make the YAML Option an one-time-option?
currently each time I restart HA the integration builds the YAML new. No big deal to delete those but kind of annoying;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants