Integrating Boston Ma. weather conditions with Hue Bulbs in sync with the John Hancock Tower

Yup, those "Temp sensor is not online, do nothing" messages mean that your weather device was not updating. Glad you figured that out!

The message should probably be changed to "Weather sensor". When I put this app together I copied a lot from another app I wrote that changes light color based on the temperature and I forgot to update that message.

I’ll change that in my copy. We had some showers in the area last night so the lights briefly changed to red a couple of times. I have the weather update time set to 5 minutes. Fun stuff! Thanks for providing some great code!


1 Like

Hi @pfmiller ,

A curiosity based on my lack of programming knowledge. I wanted to slow the flash rate to 60 seconds so I changed the input limit in your code from 10 to 60. That generated the following error:

app:5782023-03-04 08:36:40.050 AMerrorjava.lang.RuntimeException: CronExpression '*/60 * * ? * *' is invalid. on line 149 (method switchHandler)

Line 149 is:

149
schedule('*/' + flash_interval + ' * * ? * *', 'flash')

I added a line ‘cloudiness=16’ to force the flashing blue, thus the shift in line numbering.

Maybe you could just explain how that schedule command works? I was successful changing it to 30 without generating the error. As an old programmer, I’m mostly just curious.

Thanks!

The official documentation is here, follow the first link there for full details.

In short if you want a 1 minute interval the schedule command you're looking for is:
schedule('0 * * ? * *', 'flash')

This command says to run every time the clock's seconds equal 0.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.