AdyRock / com.weatherunderground

Homey app for Weather Underground
GNU General Public License v3.0
3 stars 3 forks source link

change in sun radiation won't trigger a flow #11

Closed pjmpessers closed 4 years ago

pjmpessers commented 4 years ago

Hello, Ady.

I think that change in the sun radiation won't trigger a flow since version 2.XX. When i place "sun radiation change" as a flow trigger and logica "lower then:10." the flow won't be started when it is below 10. It only starts when i let the flow start every minute so that it will look if the sun radiation is below 10.

Could you look into that?

Thanks

AdyRock commented 4 years ago

Hi Pieter,

What tag are you using for the logica (local or device)?

The only thing I can see is the order in which I check and update might be suspect. I compare the old value with the new one and fire the trigger if it is different and pass in the new value (local tag), then I update the capability (device tag). So if you use the device tag then it may not be updated at the point when the trigger is fired. I have now changed the order so the capability gets updated before the trigger so that should make sure the tag is ready when the trigger occurs. Unfortunately, my station doesn't support solar data so I have now connected to yours and will monitor the situation. So far the trigger is firing when the value changes and the logic is doing what I expect.

pjmpessers commented 4 years ago

Hello adrian.

I use the local tag. When testing the flow it is asking for the value and it works.

But when in normal use if sun radiation comes below 10 it won't trigger the flow.

-------- Oorspronkelijk bericht -------- Van: Adrian Rockall notifications@github.com Datum: 19-07-2020 08:26 (GMT+01:00) Aan: "AdyRock/com.weatherunderground" com.weatherunderground@noreply.github.com Cc: Pieter pieterpessers@hotmail.com, Author author@noreply.github.com Onderwerp: Re: [AdyRock/com.weatherunderground] change in sun radiation won't trigger a flow (#11)

Hi Pieter,

What tag are you using for the logica (local or device)?

The only thing I can see is the order in which I check and update might be suspect. I compare the old value with the new one and fire the trigger if it is different and pass in the new value (local tag), then I update the capability (device tag). So if you use the device tag then it may not be updated at the point when the trigger is fired. I have now changed the order so the capability gets updated before the trigger so that should make sure the tag is ready when the trigger occurs. Unfortunately, my station doesn't support solar data so I have now connected to yours and will monitor the situation. So far the trigger is firing when the value changes and the logic is doing what I expect.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/AdyRock/com.weatherunderground/issues/11#issuecomment-660595816, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIHBC5APQ6EURW4OAVM3KQDR4KG2PANCNFSM4PANYLUA.

pjmpessers commented 4 years ago

I will try the update later.

-------- Oorspronkelijk bericht -------- Van: Adrian Rockall notifications@github.com Datum: 19-07-2020 08:26 (GMT+01:00) Aan: "AdyRock/com.weatherunderground" com.weatherunderground@noreply.github.com Cc: Pieter pieterpessers@hotmail.com, Author author@noreply.github.com Onderwerp: Re: [AdyRock/com.weatherunderground] change in sun radiation won't trigger a flow (#11)

Hi Pieter,

What tag are you using for the logica (local or device)?

The only thing I can see is the order in which I check and update might be suspect. I compare the old value with the new one and fire the trigger if it is different and pass in the new value (local tag), then I update the capability (device tag). So if you use the device tag then it may not be updated at the point when the trigger is fired. I have now changed the order so the capability gets updated before the trigger so that should make sure the tag is ready when the trigger occurs. Unfortunately, my station doesn't support solar data so I have now connected to yours and will monitor the situation. So far the trigger is firing when the value changes and the logic is doing what I expect.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/AdyRock/com.weatherunderground/issues/11#issuecomment-660595816, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIHBC5APQ6EURW4OAVM3KQDR4KG2PANCNFSM4PANYLUA.

pjmpessers commented 4 years ago

The update did't solve the problem. I made a simple flow. When sun radiation changed->local tag: "Sun radiation above 10-> sent notification to my phone. I see in the logging it is getting it's new data from wu every minute, but the flow isn't triggered.

pjmpessers commented 4 years ago

https://homey.app/f/jb9mCd

AdyRock commented 4 years ago

Sorry I probably misslead you, I haven't pushed the changes yet. But it maybe confirms my suspicion about the order as it seems fine for me. I currently have it connected to your station and the trigger is firing as expected. I setup a flow to trigger on changes and put a logic card in the and to check the tag for greater than x, plus a notification action. I could see on the time line that I was only notified when the value was greater than x. I now have it setup as you first described so I will see if I get notified this evening when it drops below 10.

pjmpessers commented 4 years ago

Thank you i will wait patiently.

-------- Oorspronkelijk bericht -------- Van: Adrian Rockall notifications@github.com Datum: 19-07-2020 12:41 (GMT+01:00) Aan: "AdyRock/com.weatherunderground" com.weatherunderground@noreply.github.com Cc: Pieter pieterpessers@hotmail.com, Author author@noreply.github.com Onderwerp: Re: [AdyRock/com.weatherunderground] change in sun radiation won't trigger a flow (#11)

Sorry I probably misslead you, I have pushed the changes yet. But it maybe confirms my suspicion about the order as it seems fine for me. I currently have it connected to your station and the trigger is firing as expected. I setup a flow to trigger on changes and put a logic card in the and to check the tag for greater than x, plus a notification action. I could see on the time line that I was only notified when the value was greater than x. I now have it setup as you first described so I will see if I get notified this evening when it drops below 10.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/AdyRock/com.weatherunderground/issues/11#issuecomment-660623879, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIHBC5GNDVN552RYFH4GSM3R4LEVFANCNFSM4PANYLUA.

pjmpessers commented 4 years ago

I noticed this problem doesn't only happens when using sun radiation, but also by temperature change. Also tried this by a friend that bought my old homey when i bought the pro and that also uses my pws. Same problem

When i set the flow with my inside temperature meter it will be triggered.

FW 4.2.0

-------- Oorspronkelijk bericht -------- Van: Adrian Rockall notifications@github.com Datum: 19-07-2020 12:41 (GMT+01:00) Aan: "AdyRock/com.weatherunderground" com.weatherunderground@noreply.github.com Cc: Pieter pieterpessers@hotmail.com, Author author@noreply.github.com Onderwerp: Re: [AdyRock/com.weatherunderground] change in sun radiation won't trigger a flow (#11)

Sorry I probably misslead you, I have pushed the changes yet. But it maybe confirms my suspicion about the order as it seems fine for me. I currently have it connected to your station and the trigger is firing as expected. I setup a flow to trigger on changes and put a logic card in the and to check the tag for greater than x, plus a notification action. I could see on the time line that I was only notified when the value was greater than x. I now have it setup as you first described so I will see if I get notified this evening when it drops below 10.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/AdyRock/com.weatherunderground/issues/11#issuecomment-660623879, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIHBC5GNDVN552RYFH4GSM3R4LEVFANCNFSM4PANYLUA.

AdyRock commented 4 years ago

I have just remembered, when I added the new triggers for the forecast it uncovered a naming conflict between the weather station and the forecast. If you have both installed then could you delete and re-add one to see if that fixes the issue?

pjmpessers commented 4 years ago

So if i understand i must remove the weather forecast. Thanks. I will try this and let you know.

pjmpessers commented 4 years ago

Sadly enough it seems that didn't help.

AdyRock commented 4 years ago

As it was the forecast you removed, you will need to restart the app so the weather device gets initialised again so it can register the trigger.

pjmpessers commented 4 years ago

I restarted the app after removing forecast but it didn't work. In the flowchart condition i use local tag. As app I use v2.1.0. This is what's coming in:

Removed api key.

AdyRock commented 4 years ago

Ok, thanks for trying these things. When I get home I will add a few more diagnostics and push a new version to test.

pjmpessers commented 4 years ago

Thank you again. Strange that nobody has the same problem. Do you have the old version. Then i can check if that one works or there is a other problem.

AdyRock commented 4 years ago

I have pushed a new test version. Hopefully this will fix the problem as it is working OK for me with your station ID. I have also added some more diagnostics to the log just in case it is still broken.

Version 1.2.4 is available in the community app store (https://store.homey.community/app/com.weatherunderground)

pjmpessers commented 4 years ago

Hello Adrian. I'm very happy with version 1.2.4. It's triggering my flows again. I couldn't check it on sun radiation, because it's night in the Netherlands, but it triggers on wind direction and wind speed again. And with the other version it wouldn't trigger my flow with wind speed and direction. So it seems to be working again. So thank you again for solving it.

pjmpessers commented 4 years ago

Checked if the sun radiation changing is triggering my flows and it works again. Thanks Adrian.

AdyRock commented 4 years ago

Excellent, that's a relief. Thanks for letting me know.