Weather Alert (alert vs no alert)

Posted on
Sun Apr 01, 2018 10:06 am
bsp9493 offline
Posts: 153
Joined: Nov 30, 2017
Location: Kelowna, BC

Weather Alert (alert vs no alert)

Questing...

I have 2 weather triggers setup - one to to create and display text when there is an active weather alert, and one to create and display different text when there in NO active weather alert.

ie
Trigger
Type: WUnderground 7 Event
Event: Severe Weather Alert

This one works great, and activates as expected. I am actually using the Dynamic Control plugin, to create a box of a certain color, then overlay text on it and display in my Weather Control Page.

The issue i am having is, what do I use for a Trigger to identify when there is no longer a Severe Weather Alert?
I have tried a number of things, most recently...

Trigger
Type: Device State Changed
Device: myWeather
Alert - Status (I have tried a number of the available options from the dropdown here)
Becomes Equal to: False

Unfortunately, the above does NOT activate my "trigger" event (nothing in logs and then nothing to act on to to change the dynamic box I am using based on the new trigger.

WUnderground 7 events appear to be only Severe Weather Alert or Weather Location offline. Is there a way to monitor Severe Weather Alert (active or not active)?


Thanx in advance.

Dave

Posted on
Sun Apr 01, 2018 11:10 am
DaveL17 offline
User avatar
Posts: 6741
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Weather Alert (alert vs no alert)

Sorry that you're having trouble. There is not currently a way with built-in triggers to fire a trigger when there is no severe weather alert. But you should be able to build your own as you are trying to do. It is important to note that the 'alertStatus' field contains text ["true"/"false"] and not a binary [True/False] value (this is a short-coming of the plugin)*. So, consider this example:

Code: Select all
status = indigo.devices[1149686816].states['alertStatus']

indigo.server.log(str(status == False))
indigo.server.log(str(status == 'false'))

>>> False
>>> True

You'll need to set your trigger to fire when the device state 'alertStatus' becomes equal to the string 'false' or 'true' and not when it becomes the binary value False or True.

* This short-coming will probably be changed in some future version, but the decision to change it is non-trivial as it will break existing users' logic--which is not a small thing. This is why I've left it as a string for as long as I have.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Sun Apr 01, 2018 12:21 pm
bsp9493 offline
Posts: 153
Joined: Nov 30, 2017
Location: Kelowna, BC

Re: Weather Alert (alert vs no alert)

yes, makes sense.

Thank you... I'll play with that and let you know if I have any further issues:)

one other thing...

In the daily e-mail summary - rain rate and accumulation are showing as 'nm' in metric. Should be "mm"?

I keep fixing it locally in mine, but if you could add that fix to your next release it would be appreciated. Not sure if it appears anywhere else, but those are the 2 spots i noticed it.


today_qpf_metric = u"{0} nm.".format(self.floatEverything(state_name="sendMailQPF", val=today_qpf_metric))
today_qpf_standard = u"{0} in.".format(self.floatEverything(state_name="sendMailQPF", val=today_qpf_standard))
today_record_high_metric = u"{0:.0f}C".format(self.floatEverything(state_name="sendMailRecordHighC", val=today_record_high_metric))
today_record_high_standard = u"{0:.0f}F".format(self.floatEverything(state_name="sendMailRecordHighF", val=today_record_high_standard))
today_record_low_metric = u"{0:.0f}C".format(self.floatEverything(state_name="sendMailRecordLowC", val=today_record_low_metric))
today_record_low_standard = u"{0:.0f}F".format(self.floatEverything(state_name="sendMailRecordLowF", val=today_record_low_standard))
yesterday_high_temp_metric = u"{0:.0f}C".format(self.floatEverything(state_name="sendMailMaxTempM", val=yesterday_high_temp_metric))
yesterday_high_temp_standard = u"{0:.0f}F".format(self.floatEverything(state_name="sendMailMaxTempI", val=yesterday_high_temp_standard))
yesterday_low_temp_metric = u"{0:.0f}C".format(self.floatEverything(state_name="sendMailMinTempM", val=yesterday_low_temp_metric))
yesterday_low_temp_standard = u"{0:.0f}F".format(self.floatEverything(state_name="sendMailMinTempI", val=yesterday_low_temp_standard))
yesterday_total_qpf_metric = u"{0} nm.".format(self.floatEverything(state_name="sendMailPrecipM", val=yesterday_total_qpf_metric))

Thanx again for the help.

d

Posted on
Sun Apr 01, 2018 12:27 pm
DaveL17 offline
User avatar
Posts: 6741
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Weather Alert (alert vs no alert)

bsp9493 wrote:
In the daily e-mail summary - rain rate and accumulation are showing as 'nm' in metric. Should be "mm"?

Why yes, yes they should. This is now fixed and will be available in the next version of WUnderground 7.

Thanks for reporting it!

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Sat Apr 07, 2018 8:43 am
bsp9493 offline
Posts: 153
Joined: Nov 30, 2017
Location: Kelowna, BC

Re: Weather Alert (alert vs no alert)

Thanx for this... while I understand your example, I still can't seem to get my trigger to fire with NO alert (False or 'false')

status = indigo.devices[1149686816].states['alertStatus']

indigo.server.log(str(status == False))
indigo.server.log(str(status == 'false'))

>>> False
>>> True

maybe I am going about this the wrong way:( Based on the above, I have created a variable named alertStatus and I am trying fire the trigger based on that variable value.
I have tried using the Variable Changed Type and set alertStatus variable to watch for ...
"becomes false"
"becomes equal to" (and used both False and 'False'

do I need to build my trigger a different way?

Thanx in advance.

dave

Posted on
Sat Apr 07, 2018 11:55 am
DaveL17 offline
User avatar
Posts: 6741
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Weather Alert (alert vs no alert)

We may be using different terminology, but what I would suggest (if I understand your example) is to create a Device State Changed trigger like this:

Screen Shot 2018-04-07 at 12.44.44 PM.png
Screen Shot 2018-04-07 at 12.44.44 PM.png (26.2 KiB) Viewed 2685 times


That *should* work. If that doesn't work, place your cursor in the text field, hit COMMAND-A, delete everything and retype false in to the field (there could be a space or hidden character in there that you can't see)..

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest