$twcweather.conditions.temperature

temperature

#1

**1) About 6 weeks ago, a piston started acting inconsistently. I have a piston to set a “Bitter Cold Flag” when the outside temperature falls below 19°F to let my thermostat manager know to only use emergency heat, not heat pump. It’s summer time now where I live, and lately, that “Bitter Cold Flag” has been set seemingly randomly and my thermostat manager switches from Cool to Emergency Heat. This is not “cool”. It almost seems the piston is being triggered by 19°C instead of 19°F. Is there a way to ensure the condition only triggers on F and not C?


#2

I would be tempted to add a “Log to console” inside the THEN block to see what is going on.

Something like this:

The reason I suggest this is, there is a good chance that TWC sends back a ‘0’ when it cannot pull the real data. (This used to happen to WUnderground about 1% of the time)


PS. I had to use a variable so the piston only pulls data once per execution.

PPS. I expect this to happen more and more often as people try to spam the weather servers this frequently. If it were me, I would limit this piston to only running once per hour.


#3

Pro Tip:
You can also limit this by adding one more condition (highlighted):

This extra condition will only let it run November 1st thru March 31st.


For what it’s worth, I still highly recommend reducing the frequency on this piston. Every hour would be my recommendation, but there is absolutely no reason to drop less than every 15 minutes.

Running every minute will negatively impact all of your other home automation.
(not to mention it impacts other people doing weather queries as well)

I might even go as far as to say, a likely reason you are occasionally getting bad data (zero) is because someone else is spamming the weather server at the same time you are…
(IE: you are living proof of what happens when too many requests come in at once)


#4

Thanks for your response and excellent tips. I have adjusted the $twcweather.conditions.temperature polling to every 5 minutes to reduce spamming. I set up a variable to capture the outside temperature so I’m not constantly polling the temperature in evaluating an expression. I’m not able to log the outside temperature in my log statement (see logs). I have a difficult time understanding the correct syntax in this language, so any tips are appreciated. I didn’t see a “debug” feature in the WebCore log to Console command.


#5

I must emphasize that the logic I used above will not work with a global variable. It must be a local variable to function properly.


Here is the button to press to upload an image in this forum:

temp


The “Debug” is optional. It just changes the color of the log so it stands out from all the other stuff.

temp


#6

Sample showing the five log colors: