Piston won't set Nest heat


#1

The idea of this piston is to turn the heating on ahead of schedule if it is particularly cold.

The problem is that it isn’t setting the thermostat. I can see in the events on the hub (not webcore) that it is doing something, but the heating isn’t coming on.

heat2

Code:


#2

Can you post the piston’s log - if the IDE is showing that the nest is getting the command, lets see what it got :slight_smile:

Not sure why this is not working though


#3

It says the log is empty. Logging was set to none though so i’ve changed it to full.

I’ve used the right terms as in, temperature is less than is the room temperature and not some other temperature right?

And do I set the heating point or another function?

It was 10degrees in the room at 4:45 yesterday and the heating hadn’t come on.


#4

So without seeing the logs… The issue as I see it is that you’re using two conditions which WC is then turning into Triggers to initiate the kick off of this piston…however, I’m not sure those are the best conditions to use for what you want to accomplish.

I think WC works best when you use it as an Event based rules engine. So in this example…if you were to check the Temperature once at 4PM to see if you needed to turn on the heat that would work just fine. Or if you were to check every, let’s say, 10 minutes between 4 and 5 I could easily see that working flawlessly as well… But the way this is coded right now makes it seem a bit fuzzy to me.

What is WC going to do here? It’s certainly not going to check every millisecond between 4 and 5 to see if it needs to turn on the heat…is it going to check once at 4 and again at 5? I honestly don’t know because I don’t think that using Time as a condition makes it act like a Trigger in this manner.

So…bottom line… Unless one of the Minions comes along and points out the flaw in my logic here (it’s happened before) I believe you need to change what you are doing here and use some actual Triggers in this piston.


#5

OK…I answered my own question because I needed to know. When you use Time is between as a condition like this then WC will check once at the start of the Time period and once again at the end of the Time period.

So in your case, it will check once at 4PM and once again at 5PM. It will do nothing at all in between those two time periods.

However, in this little test that I just did…when it checks the time at the end of the Time period that condition is no longer true. So the piston evaluated the Time condition as False and just exited without running.

So once again… I think you’ll need to redesign your piston because using Time as a condition like this probably isn’t how you want it to work.


#6

This makes sense. I’ve changed it to ‘happens daily at 4pm’

See if it works.

Thanks!


#7

I’m relatively new to webCoRE (although I used CoRE for a while before using webCoRE), but my understanding is with the Piston as originally written, it will subscribe to two types of events: time and Thermostat 1’s temperature attribute. That’s what the lightning bolts on the left side imply. You should also see this when the Piston is started (i.e., with logging enabled and after editing and saving the script.) So, if the temperature changes, it should cause the Piston to run (as well as at 4 and 5 on a weekday.)

So, basically, when the temperature changes, that’s effectively a trigger, and in this case, time will be effectively a filter. And, when the time is 4 or 5 (on weekdays), time will be the trigger, and the temperature will act as a filter. And in both cases (temperature changes, or at 4 or 5) you should see the Piston running in the WC log for this Piston.

Given you’re seeing the setHeatingSetpoint in the ST IDE event log for the thermostat, I’d say the WC Piston is doing what you want. But, …

Is it possible either the Nest Thermostat itself, or the Nest Manager SmartApp (which I assume you’re using) has changed the thermostat’s mode, say to eco mode, or off? If so, then changing the heating set point won’t have any effect until the thermostat goes back to heat mode.


#8

While I agree with this, if temp is false at 4pm, then the statement is false.
If the temp drops to 13 or below then the piston is re-evaluated and will check the time and therefore be true if time is between 4 and 5.
This is my understanding on how this would work.
I have lights that come on with motion and I have set the piston so that if it is between certain time frames, the lights come on at different levels.
I may be wrong here but that is my understanding on how it would work in this scenario.


#9

Yeah, I’ll admit, this is a confusing one to me… It’s at the heart of how WC works when it uses two conditions in a statement to determine whether or not to take action. it’s a bit easier (for me at least) to look at the absolute nature of a Timer or a Timed event.

We don’t have the logs so we really can’t tell why this one didn’t work for him when the Temp was below the value he set. My little test was setup in such a way that it was only really testing one half the the IF statement and not the other.

Logs/logging and more testing would certainly be the way to dig into this one deeper.


#10

Totally agree about the logs.
We can all look and think we know what is happening (there are numerous pistons that I’ve built that should work but don’t :smile: ) you cannot beat having logs to go through.


#11

Logs look fine. The issue is with NST manager. It ALWAYS reports the ambient temperature as 13.5deg.
If I try and go into NST through the ‘things’ part of the smartthings app, it just constantly loads.

Updated from github and still same issue.