vinteo / hass-opensprinkler

OpenSprinkler Integration for Home Assistant
MIT License
204 stars 40 forks source link

Rain delay not working from automation #282

Closed Alby247 closed 5 months ago

Alby247 commented 5 months ago

In my automation I have:

  - service: opensprinkler.set_rain_delay
    data:
      rain_delay: 4
      entity_id: sensor.opensprinkler_rain_delay_stop_time

When I run this I get an error message

Error running action

Unknown error

The automation doesn't work of course.

In the OpenSprinkler card on a dashboard I can see the rain delay setting update if I change it in OpenSprinkler directly, but no change if done via the automation.

Calling the service from Developer tools tab with debug connection turned on, I get this in the browser console:

Failed to register/update a ServiceWorker for scope ‘https://opensprinkler.mydomain.com/’: Bad Content-Type of ‘application/json’ received for script ‘https://opensprinkler.mydomain.com/sw.js’. Must be a JavaScript MIME type. 2 NS_ERROR_NOT_AVAILABLE this.window.gBrowserInit is undefined

I'm using HAOS on a Lenovo PC bare metal

Core 2024.3.1 Supervisor 2024.03.0 Operating System 12.1 Frontend 20240307.0

and Opensprinkler on a PiZeroW

Opensprinkler app version 2.3.3 Firmware 2.1.9 (11) Hardware version: OSPi

Home Assistant server and Openspinkler PiZeroW are on different subnets, but no ACL rules blocking communication (as evidenced by the HA dashboard card working normally).

vinteo commented 5 months ago

I can't immediately see any issues, is it only the rain delay service that doesn't work? Do any of the other services work? DId it ever work before?

If possible, one thing to try is to update the the firmware on the OpenSprinkler device as the latest is 2.2.0

Alby247 commented 5 months ago

I can enable/disable OpenSprinkler via calling the service from HA, haven't tried anything else, will do so after work tonight when I get home.

I was previously disabling OS altogether for rain delay not realising this was on option. That worked but it was a bit clunky as it required helpers, and this should work so I'm keen to pursue it.

I'll also look into updating the firmware when I get a chance. It's been very reliable though so I'm a bit hesitant to change anything.

Alby247 commented 5 months ago

I uninstalled the integration, then delete the Opensprinkler folder in config/custom_components.

Restarted HA and went back to reinstall Opensprinkler, interesting it was listed as pending upgrade so I upgraded, restarted HA, resetup the integration, now all working fine.

So it was clearly an issue in my specific configuration.