Time,Location,Door contact help


1) Give a description of the problem
I’m stuck, I dont understand how I can colsolidate time and location to make this piston easier to read and without having to add alot of extra conditions or how to add a condition to check if a doors are open or not.

2) What is the expected behaviour?
Well, I would like to have different temperature depending on the time, if Im home or away and also to check if my kids doors are open if so I would like to increase the heat so they dont get cold during the winter months and to see if any windows are open in which case shut down the heat.

3) What is happening/not happening?
I use 3 of the same piston as Im using virtual thermostat to control my heat pumps but I lose alot of energy if I can’t control them as I want, no point heating the house alot if my wife / kids or me are home.

**4) Post a Green Snapshot of the piston!

5) Attach logs after turning logging level to Full
No errors yet.

I would be very glad if anyone could help me setup time / location and sensor thingies to work with the above piston or point me in the right direction. Quite new so easy instructions would be awesome :slight_smile:

Best regards,


First of all I would write the piston with the home or away condition in the back your mind as the base to work from. So in your example I would add to the “every 5 Minutes” block another restriction such as “only when location mode is home”. That way this piston addresses only the instance when that is true and you could remove it from all your other subsequent blocks. Write your entire piston the way you would want it as when you are home. Save and then copy to a second piston and change the mode to away. Now adjust all the temps and/or times to when you are away.

Personally I am on the fence about telling a HVAC system a temperature setting this often as you have it set for every 5x minutes. In my experience (in Florida) it takes a minute for any real change to become apparent in the room. Also this could place a considerable strain on your system to constantly keep running if it it works in such a fashion that each temperature call turns it on.


It’s a heat pump inverter, made a virtual switch ON equals 23C, heat mode, fan high, OFF is OFF.
Linked this to a virtual thermostat. won’t cause any problems what so ever.

The restriction part is a good tip, I was hoping not having several pistons for time / location but to keep them local within each thermostat piston, easier to manage.
I have 3 thermostats now but once this is working fine I’ll add 7 more, it would be tons of pistons.

Thank you kindly!


If all the thermostats are the same and function the same and are going to get the same commands you could define a variable in the top of the piston, and populate that with all the thermostats. From that point on any time you need to take action on the thermostats you can use that variable and have a single device showing instead of all X amount spelled out for each instance.

You could also set them as a global variable for use across different pistons again assuming that they all would get the same command, etc.


Hi, thanks for your reply.
I experienced it having it set every 5x minutes wasn’t such a good idea afterall, I have one heat pump in the bedroom and the display lit up everytime it was sent a command, it woke up my son a few times.
Reason I did it like that is if anyone did any manual change on the AC heat pump itself, it would reset to the value I set in the piston.
I would adjust the temperature inside the piston or atleast try to set a temperature everyone is comfortable with so in the end one doesnt have to fiddle with the remote at all.

I wish I could keep them all in the same variable as that would make things easier but unfortunately that’s not possible I think.
One AC is in the living room, one upstairs and one in the bedroom.

The way I was hoping it to work is to have upstairs and bedroom AC act depening what door is open or not.

Between checking time, location and temperature I just don’t know how to fit in contact sensors into the mix.
It would be a spider net if I were even able to make such a code, perhaps I just don’t understand the how-to and Im missing something.


The simplest reply to this in my opinion would be to then write a piston per room that has a thermostat. In my case I find that using contact sensors sends too many commands to my AC with having pets and people constantly coming and going. My solution to that was to put time delays in. if door has been open for longer than X do Y.

I would say start with a basic piston for how you want one particular room to work. Fine tune that and then see if thats scalable into multiple rooms either via more pistons or more variables. Have to start somewhere :slight_smile: