jtebbens / com.homewizard

Homewizard app for Homey
9 stars 7 forks source link

Rainmeter trigger not working properly #13

Closed EricMuhren closed 5 years ago

EricMuhren commented 5 years ago

Hi Jeroen,

I tested the rainmeter trigger and it is not working properly. The trigger doesn't stop firing. Every few seconds it is fired, again and again. 0.7 mm, 0,7 mm etc.

jtebbens commented 5 years ago

Ok will change it to last 3hours to see of that improves it.

EricMuhren commented 5 years ago

No, that's not neccesary. The rainmeter works as follows: 0,7..1,4..2,1...2,8...etc. At 00:00 it is resetted to 0.

EricMuhren commented 5 years ago

So you have to check if the previous value is less than the current value except when the current value is 0 and the previous value is greater than 0 .

jtebbens commented 5 years ago

Funny enough that is exactly do:

if (rain_daytotal != devices[device_id].last_raintotal)

Kind regards / Groet, Jeroen

Op 9 sep. 2019 om 17:41 heeft EricMuhren <notifications@github.com mailto:notifications@github.com > het volgende geschreven:

So you have to check if the previous value is less than the current value except when the current value is 0 and the previous value is greater than 0 .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

EricMuhren commented 5 years ago

Yes, I can see it in the code, but there must be a reason why the trigger is fired every 5 seconds or so... Perhaps you can have a look at the value of devices[device_id].last_raintotal. If this value stays 0 or isn't updated properly then the trigger is fired more than once.

jtebbens commented 5 years ago

Ok issue resolved (I hope). Beta release uploaded (awaiting of approval). You can dev install it from the beta branch from this repository.

jtebbens commented 5 years ago

Beta release is now available in the app store.

EricMuhren commented 5 years ago

Thanks, but how did you solve the issue? I don't see changes in the code and the file/folder dates didn't change either. Tommorow it's going to rain. Then I can test it again.

jtebbens commented 5 years ago

Code is in the beta branch. The "last" value stayed undefined from previous poll so I resolved it when the trigger hits.

EricMuhren commented 5 years ago

OK, now I've found the changed. Looks good. How do I install the beta branch in Homey. Is it just updating the beta in the store? Or do I have to do something else? I'm a little bit of a newbe in the Homey world.

jtebbens commented 5 years ago

Yes just 10 min ago I published the beta channel to 0.2.4 update so in the app store you can select the beta channel install.

Kind regards / Groet, Jeroen

Op 10 sep. 2019 om 20:11 heeft EricMuhren <notifications@github.com mailto:notifications@github.com > het volgende geschreven:

OK, now I've found the changed. Looks good. How do I install the beta branch in Homey. Is it just updating the beta in the store? Or do I have to do something else? I'm a little bit of a newbe in the Homey world.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

EricMuhren commented 5 years ago

OK, that's clear to me then. Good job!

I've lost the Homewizard device, so I had to configure all devices and repair the flows. That's not so funny. And I lost the insights as well. I was afraid this was going to happen....disappearing the project on Github. The Homewizard has got a new ID.

jtebbens commented 5 years ago

Sorry to hear, not sure why/how you lost it. I install various versions all the time either in developer mode or from the app store. I do had these glitches but those were before Homey firmware 2.0

Kind regards / Groet, Jeroen

Op 10 sep. 2019 om 20:21 heeft EricMuhren <notifications@github.com mailto:notifications@github.com > het volgende geschreven:

OK, that's clear to me then. Good job!

I've lost the Homewizard device, so I had to configure all devices and repair the flows. That's not so funny. And I lost the insights as well. I was afraid this was going to happen....disappearing the project on Github. The Homewizard has got a new ID.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

EricMuhren commented 5 years ago

OK Jeroen. I hope this won't happen anymore in the future. I design apps for Garmin devices and over there I and others have to deal with the same kind of (firmware) problems.

jtebbens commented 5 years ago

Yeah same, else we will have some unhappy consumers of this app. But sadly beyond me to resolve. We need the backup feature Athom promised long long long long time ago.

Kind regards / Groet, Jeroen

Op 10 sep. 2019 om 20:38 heeft EricMuhren <notifications@github.com mailto:notifications@github.com > het volgende geschreven:

OK Jeroen. I hope this won't happen anymore in the future. I design apps for Garmin devices and over there I and others have to deal with the same kind of (firmware) problems.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

EricMuhren commented 5 years ago

I use this for backup. Works very well.

https://homeybackup.web.app/login

Info page: https://community.athom.com/t/community-backup-restore-for-homey-v2-alpha-version/13727

jtebbens commented 5 years ago

Ah Geurt Dijker has been busy, ok will have a look myself. But I understand this didnt restore your Homewizard device then?

EricMuhren commented 5 years ago

Good question. I didn't try it! Stupid....

jtebbens commented 5 years ago

Sorry I am just the messenger. ;)

EricMuhren commented 5 years ago

Hi. It was a rainy day today, so I had the chance to test the rain trigger. It's working fine, but the refresh rate is too low. Sometimes I have to wait for more than an hour to see it refreshing the values. And that's not very useful if you want to control the blinds or sunscreen and protect them against the rain.

Rainmeter refresh lasted more than one hour regen 1

Energy meter refresh a within a few seconds regen 2

Live rainmeter at the same time: regen 3

jtebbens commented 5 years ago

Strange it polls every 10 seconds

Verstuurd vanaf mijn iPhone

Op 11 sep. 2019 om 20:14 heeft EricMuhren <notifications@github.com mailto:notifications@github.com > het volgende geschreven:

Hi. It was a rainy day today, so I had the chance to test the rain trigger. It's working fine, but the refresh rate is too low. Sometimes I have to wait for more than an hour to see it refreshing the values. And that's not very useful if you want to control the blinds or sunscreen and protect them against the rain.

Rainmeter refresh lasted more than one hour

Energy meter refresh a within a few seconds

Live rainmeter at the same time:

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

EricMuhren commented 5 years ago

Yes, I saw it in the code (1000 * 10). But why isn't it refreshing every 10 seconds (see screenshot)? Is it Homey, is it the app or is it the Homewizard?

I've written a Python program to log the rainfall measured by the Homewizard. As you can see the Homewizard reports every 10 minutes. No problem at all. So it must be the Homey or the app.

2019-09-11;10:27:06;0.0;0.0 2019-09-11;10:37:08;0.7;0.7 2019-09-11;10:47:09;0.7;0.7 2019-09-11;10:57:10;0.7;0.7 2019-09-11;11:07:34;0.7;0.7 2019-09-11;11:17:35;0.7;0.7 2019-09-11;11:27:36;0.7;0.7 2019-09-11;11:37:38;0.7;0.7 2019-09-11;11:47:40;0.7;0.7 2019-09-11;11:57:41;0.7;0.7 2019-09-11;12:07:43;0.7;0.7 2019-09-11;12:17:45;0.7;0.7 2019-09-11;12:27:47;0.7;0.7 2019-09-11;12:37:49;0.7;0.7 2019-09-11;12:47:50;0.7;0.7 2019-09-11;12:57:51;0.7;0.7 2019-09-11;13:08:15;0.7;0.0 2019-09-11;13:18:16;0.7;0.0 2019-09-11;13:28:18;0.7;0.0 2019-09-11;13:38:19;0.7;0.0 2019-09-11;13:48:20;0.7;0.0 2019-09-11;13:58:22;0.7;0.0 2019-09-11;14:08:24;0.7;0.0 2019-09-11;14:18:26;0.7;0.0 2019-09-11;14:28:27;0.7;0.0 2019-09-11;14:38:28;0.7;0.0 2019-09-11;14:48:30;0.7;0.0 2019-09-11;14:58:31;0.7;0.0 2019-09-11;15:08:55;0.7;0.0 2019-09-11;15:18:56;1.4;0.7 2019-09-11;15:28:57;2.1;1.4 2019-09-11;15:38:59;2.1;1.4 2019-09-11;15:49:00;2.1;1.4 2019-09-11;15:59:01;2.8;2.1 2019-09-11;16:09:03;2.8;2.1 2019-09-11;16:19:04;2.8;2.1 2019-09-11;16:29:05;2.8;2.1 2019-09-11;16:39:07;2.8;2.1 2019-09-11;16:49:08;2.8;2.1 2019-09-11;16:59:09;2.8;2.1 2019-09-11;17:09:33;2.8;2.1 2019-09-11;17:19:34;2.8;2.1 2019-09-11;17:29:36;2.8;2.1 2019-09-11;17:39:37;2.8;2.1 2019-09-11;17:49:38;2.8;2.1 2019-09-11;17:59:42;2.8;2.1 2019-09-11;19:13:58;3.5;0.7 2019-09-11;19:24:01;3.5;0.7 2019-09-11;19:34:03;3.5;0.7 2019-09-11;20:17:20;3.5;0.7

EricMuhren commented 5 years ago

Now I see a gap in the readings at 18:00 hour of one hour. So it must be the Homewizard. Let's restart that one....!!!

EricMuhren commented 5 years ago

Hi Jeroen, I think 0.2.4 is OK and works fine. The Homewizard stopped refreshing the rain values for some reason. I'll investigate that.

Thanks for adding the trigger! :-)

jtebbens commented 5 years ago

Ok thanks for confirming. Yeah HomeWizard can be dodgy once in a while. WiFi ain’t its best chip and sometimes asking every 10 seconds could result in temporary disconnects. I had 3 different bash shell scripts running for Energylink (PVOutput tracking etc.) and added Domoticz to integrate as well. My HomeWizard crippled regularly due to many sessions active.

I will publish this 0.2.4 version to stable but will check if an increase to perhaps 20 seconds would benefit the overall stability between Homey and HomeWizard.

Verstuurd vanaf mijn iPhone

Op 11 sep. 2019 om 21:23 heeft EricMuhren <notifications@github.com mailto:notifications@github.com > het volgende geschreven:

Hi Jeroen, I think 0.2.4 is OK and works fine. The Homewizard stopped refreshing the rain values for some reason. I'll investigate that.

Thanks for adding the trigger! :-)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

jtebbens commented 5 years ago

With your permission I will close this issue and mark it as resolved.