jeroenterheerdt / HAsmartirrigation

Smart Irrigation custom component for Home Assistant
MIT License
308 stars 48 forks source link

Use OpenMapWeather One Call API 3.0 #119

Closed f1ren closed 11 months ago

f1ren commented 1 year ago

New API keys seem to have no access to OpenMapWeather API 2.5. This PR was tested on an API key that was generated on Dec 17, 2022.

SebastianSiegl commented 1 year ago

Hi, I am still receiving an error after installing is PR:

image

fbloemhof commented 12 months ago

You need to subscribe for the paid plan to get it working with a new API key and this PR. The paid plan has 1000 calls per day for free, so it probably will be free unless you have a lot of sprinklers. ;)

I think it would be wise to make the API version configurable. For those who are using the addon on 2.5 with no issues (and maybe without subscription), it might be a breaking change if you update to 3.0?

jeroenterheerdt commented 11 months ago

agreed, we should make the API version selectable when configuring this add-on. I am not merging this for now.

rrozema commented 11 months ago

NOT merging it breaks the installation for those that did have to change to API 3, like me... So, i don't see why you shouldn't merge it?

jeroenterheerdt commented 11 months ago

Because so many users would be broken as they are using API 2. I will merge it when I figured out how to make the API version configurable or auto detect the version.

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: rrozema @.> Sent: Tuesday, June 20, 2023 4:52:57 AM To: jeroenterheerdt/HAsmartirrigation @.> Cc: Jeroen ter Heerdt @.>; Comment @.> Subject: Re: [jeroenterheerdt/HAsmartirrigation] Use OpenMapWeather One Call API 3.0 (PR #119)

NOT merging it breaks the installation for those that did have to change to API 3, like me... So, i don't see why you shouldn't merge it?

— Reply to this email directly, view it on GitHubhttps://github.com/jeroenterheerdt/HAsmartirrigation/pull/119#issuecomment-1598630515, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB6PIPWCEECB55YSDDWAPNDXMGFJTANCNFSM6AAAAAATHB7CRU. You are receiving this because you commented.Message ID: @.***>

jeroenterheerdt commented 11 months ago

@rrozema can you try https://github.com/jeroenterheerdt/HAsmartirrigation/releases/tag/v0.0.80?

rrozema commented 11 months ago

How do I go about updating it? I installed from HACS (and just updated to v.0.0.79). Is just replacing the one file OWMClient.py, then restart HA sufficient?

jeroenterheerdt commented 11 months ago

Install it from HACS, make sure you show "beta builds". Version you install should be v0.0.80.

Restart HA after installing v0.0.80

From: rrozema @.> Sent: Tuesday, June 20, 2023 10:46 AM To: jeroenterheerdt/HAsmartirrigation @.> Cc: Jeroen ter Heerdt @.>; Comment @.> Subject: Re: [jeroenterheerdt/HAsmartirrigation] Use OpenMapWeather One Call API 3.0 (PR #119)

How do I go about updating it? I installed from HACS. Is just replacing the one file, then restart HA sufficient?

- Reply to this email directly, view it on GitHubhttps://github.com/jeroenterheerdt/HAsmartirrigation/pull/119#issuecomment-1599244421, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB6PIPRPVV4RYLVT47M6OODXMHOULANCNFSM6AAAAAATHB7CRU. You are receiving this because you commented.Message ID: @.**@.>>

ScratMan commented 11 months ago

How do I go about updating it? I installed from HACS. Is just replacing the one file, then restart HA sufficient?

Go to HACS > Integrations > Smart Irrigation. Then, open the three dots menu in the top right corner and select to redownload the integration. There, enable the betas versions and select the 0.0.80 in the list.

rrozema commented 11 months ago

yes, figured that out (had to select an older version first before it would let me select 0.0.80). It is installed. Do you need me to look at anything in particular? I am on discord too under the same name b.t.w.

2023-06-20 20:14:47.675 INFO (MainThread) [custom_components.smart_irrigation] Initial update triggered - calling calculate hourly adjusted run time now. 2023-06-20 20:14:47.675 INFO (MainThread) [custom_components.smart_irrigation] Calculate Hourly Adjusted Run Time service called, calculating now. 2023-06-20 20:14:47.676 INFO (MainThread) [custom_components.smart_irrigation] Updating Smart Irrigation Data 2023-06-20 20:14:47.906 INFO (SyncWorker_0) [custom_components.smart_irrigation.sensor] _hourly_data_updated, calling update_state for type Hourly Adjusted Run Time 2023-06-20 20:14:47.906 INFO (SyncWorker_0) [custom_components.smart_irrigation.sensor] update_state for type: Hourly Adjusted Run Time 2023-06-20 20:14:47.906 INFO (SyncWorker_0) [custom_components.smart_irrigation.sensor] rain: 12.85, snow: 0 2023-06-20 20:14:47.907 INFO (SyncWorker_0) [custom_components.smart_irrigation.sensor] calculated evapotranspiration: 5.968721845606208 2023-06-20 20:14:47.907 INFO (SyncWorker_0) [custom_components.smart_irrigation.sensor] Calculated water_budget = 0 and adjusted_run_time: 0 for type: Hourly Adjusted Run Time. Bucket value was: 6.881278154393792, and base schedule index is: 228.23999999999998, force mode is: False, force mode duration is: 0, lead_time is: 0, maximum_duration: -1, change percentage: 1.0, type: Hourly Adjusted Run Time 2023-06-20 20:14:47.907 INFO (SyncWorker_0) [custom_components.smart_irrigation.sensor] update_state: just updated hourly_precipitation_list: [12.85, 12.85, 12.85] and hourly_evapotranspiration_list: [5.968721845606208, 5.968721845606208, 5.968721845606208] 2023-06-20 20:14:47.908 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state for type: Hourly Adjusted Run Time 2023-06-20 20:14:47.908 INFO (MainThread) [custom_components.smart_irrigation.sensor] rain: 12.85, snow: 0 2023-06-20 20:14:47.908 INFO (MainThread) [custom_components.smart_irrigation.sensor] calculated evapotranspiration: 5.968721845606208 2023-06-20 20:14:47.908 INFO (MainThread) [custom_components.smart_irrigation.sensor] Calculated water_budget = 0 and adjusted_run_time: 0 for type: Hourly Adjusted Run Time. Bucket value was: 6.881278154393792, and base schedule index is: 228.23999999999998, force mode is: False, force mode duration is: 0, lead_time is: 0, maximum_duration: -1, change percentage: 1.0, type: Hourly Adjusted Run Time 2023-06-20 20:14:47.909 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state: just updated hourly_precipitation_list: [12.85, 12.85, 12.85, 12.85] and hourly_evapotranspiration_list: [5.968721845606208, 5.968721845606208, 5.968721845606208, 5.968721845606208] 2023-06-20 20:14:47.909 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state for type: Hourly Adjusted Run Time 2023-06-20 20:14:47.909 INFO (MainThread) [custom_components.smart_irrigation.sensor] rain: 12.85, snow: 0 2023-06-20 20:14:47.909 INFO (MainThread) [custom_components.smart_irrigation.sensor] calculated evapotranspiration: 5.968721845606208 2023-06-20 20:14:47.909 INFO (MainThread) [custom_components.smart_irrigation.sensor] Calculated water_budget = 0 and adjusted_run_time: 0 for type: Hourly Adjusted Run Time. Bucket value was: 6.881278154393792, and base schedule index is: 228.23999999999998, force mode is: False, force mode duration is: 0, lead_time is: 0, maximum_duration: -1, change percentage: 1.0, type: Hourly Adjusted Run Time 2023-06-20 20:14:47.909 INFO (MainThread) [custom_components.smart_irrigation.sensor] update_state: just updated hourly_precipitation_list: [12.85, 12.85, 12.85, 12.85, 12.85] and hourly_evapotranspiration_list: [5.968721845606208, 5.968721845606208, 5.968721845606208, 5.968721845606208, 5.968721845606208]

jeroenterheerdt commented 11 months ago

See if you can configure it with your 3.0 API key and get no errors 😊

rrozema commented 11 months ago

My OpenWeatherMap key was generated beginning of this june and I did have to register with a creditcard, i.e. it has access to the 3.0 api only (it failed when I tried to access the 2.5 API in beginning of June). I did not re-enter any key information after installing 0.0.80, yetthis v0.0.80 does seem to successfully get information of of OWM.

f1ren commented 11 months ago

Resolved in this commit.

edgimar commented 11 months ago

Presumably this also fixes #112 and #120.

fbloemhof commented 10 months ago

@jeroenterheerdt when are you planning to release the 0.0.80 version? HACS has some issues here with the prerelease so the updates are switching between .79 en .80 almost daily.

jeroenterheerdt commented 10 months ago

@fbloemhof good call, thanks for reminding me. I will publish it ASAP.