MTry / homebridge-smart-irrigation

Turn any electrical irrigation valve into a smart-valve.. or run your pumps on a smart schedule based on your climate! This homebridge plugin exposes a multi-zone irrigation sprinkler dummy control system to Apple's HomeKit. Although a dummy, it brings smarts of an evapotranspiration based climate and plant adaptive irrigation controller with the use of OpenWeatherMap API. The plugin can optionally email you, and/or send you push notifications through Pushover or Pushcut, with the watering schedule it has calculated, or when a watering run is completed, along with the next 7-day weather forecast. Added option to expose system controls to Homekit allowing a user to enable/disable irrigation, rechecks, push and email notifications from within the Home App. Associated WaterLevel Characteristic shows the % of watering cycle remaining.
MIT License
78 stars 4 forks source link

Openweathermap update to 3.0 #67

Open Jeffaffa opened 1 month ago

Jeffaffa commented 1 month ago

Openweather is upgrading towards version 3.0. It seems version 2.5 is not working anymore with the current version of smart irrigation.

Error getting weather data or Response code 401 (Unauthorized)

Vagenthar commented 1 month ago

This is one of the best plugins for homebridge. Please update it.

Jeffaffa commented 1 month ago

I changed the code on line 168 of index.js from 2.5 to 3.0.

const url = 'https://api.openweathermap.org/data/3.0/onecall?lat=

Now it works again.

Vagenthar commented 1 month ago

And how I can do that ?

Jeffaffa commented 1 month ago

edit this file homebridge\node_modules\homebridge-smart-irrigation\index.js

search for https://api.openweathermap.org/data/2.5/ and replace 2.5 with 3.0

Vagenthar commented 1 month ago

Thanks that worked.

cladmonitor commented 1 month ago

Thanks for the detail, also you need to subscribe to the new one call 3.0 service. It will require a CC but has 1000 call per day base which is totally free. Once you subscribe it will take appx 30min for the subscription to be come active regardless if you get an email stating it’s active or not. They do have a simply web request link in the email though so you can see if you’re still getting a 401 or if it’s working. As soon as I changed the 2.5->3.0 in the code, restarted homebridge and subscribed to the new service I got a push notification about 30min (from my configured pushover endpoint) saying the irrigation was scheduled properly.

Hope this helps!