HVAC control when away and guests change setpoint

So, I recently discovered home assistant last night and got everything set up to automate the task that I have been interested in for quite some time now.

I have guests living with me temporarily. I have my thermostat set up to 75 while away which is a reasonable temperature for my guests who don’t pay any bills. The problem is I will get off work and notice that the thermostat was manually set to 70. I already gave an amount of time they could stay with me, and I will just have to deal with this until then. Here is what my intentions are

Task steps:

-Run task every 20 minutes

-if I am not home and the set temperature is below 75 (there’s 2 ways to do this with my t-stat)

  • then (

  • send a notification to my phone

-change the hvac mode to cool (we live in Texas). My t-stat is usually in auto with a heat setpoint and a cool setpoint or it can be in cool mode with only a cool setpoint (still auto)

-set temp to 75

)

-done

So far, I think the task has been working the way I want it to. I tested the task 2 ways. First with a gps simulator on my phone to simulate being away and changing the set temp below my desired setpoint, 75. Also, I tested separately by changing “pixel is not home” to “pixel is home” and changing the temp below the sp.

My phone location would not update when I would leave my home network, so I used DuckDNS to access my Home Assistant server on my phone while I was off the home Wi-Fi so my phone location would update. Can anyone tell me if this was even necessary, and is this even a safe way to do this?

I did notice that when I was away and changed the temp below 75 from my t-stat app it did change to my desired setpoint, but I did not get a notification.

Eventually I plan to run my HA server on a raspberry Pi or an old laptop I don’t care for but for now its running on my desktop until I get familiar with HA.

Questions:

Did I set up my HA task correctly, what would you have done differently?

Was it necessary to use DuckDNS, or something similar so I could get my phone location to update when off the home Wi-Fi? Was that method even safe?

Any ideas why when I am off the home network, I don’t receive a notification, but the task does change the setpoint back to 75?

I’m basically a HA newborn so I apologize if I left out any useful information that would be needed to answer my questions.

if:
  - condition: and
    conditions:
      - condition: device
        device_id: ###
        domain: device_tracker
        entity_id: ###
        type: is_not_home
      - condition: or
        conditions:
          - condition: numeric_state
            entity_id: climate.t9_thermostat
            attribute: target_temp_high
            below: 75
          - condition: numeric_state
            entity_id: climate.t9_thermostat
            attribute: temperature
            below: 75
then:
  - service: notify.mobile_app_pixel_8
    metadata: {}
    data:
      message: TEMPERATURE CHANGED
      title: Thermostat
  - service: climate.set_hvac_mode
    metadata: {}
    data:
      hvac_mode: cool
    target:
      entity_id: climate.t9_thermostat
  - service: climate.set_temperature
    metadata: {}
    data:
      temperature: 75
    target:
      entity_id: climate.t9_thermostat

Posting yaml instead of a picture is the preferred way here. It allows others to copy/paste code into their test system if they want/need.

See this post, specifically number 11 for how to do that.

What does the trace say about your notify command? Was there any issue shown there?

Including link: How to help us help you - or How to ask a good question.

1 Like

So sorry. I copied the link. Forgot to paste it in.

Thanks for covering!

1 Like

I have two automations. If the AC is below 72°F for more than 5 minutes, it sets the AC to 75°F. If the heat is above 75°F for more than 5 minutes, it gets set to 72°F.

This way when my kids are house sitting for me, I don’t care that they set the AC to 65°F (they do). The house will cool a bit then the thermostat goes back to my 75°F setpoint, and they don’t notice.

2 Likes

Agree. Instead of a 20 minute trigger, you can trigger on the temperature settings.

No idea, can’t read it. Post code next time, not a picture in 4 point text.

Yes, and no. If all you wanted to know as home or not home, then you could have just used a WiFi tracker instead. If you want the actual location, then yes.

“safe” is a relative term, and without knowing anything else about your network and how you’ve configured everything, it is impossible to even BEGIN to hazard any type of remotely educated response, and anyone who does is either guessing, lying, or both.

Nevermind about changing the setpoint. You’ve already confirmed that works. Your issue isn’t that the notification isn’t being sent (you’ve already confirmed that you get the notification when you’re at home using a GPS “cheater”, right?), your issue is most likely that you have communication problems between HA and your phone when you’re not connected to your network. You say that you’ve changed the temp on your t-stat app - why would you do that? Why are you not changing it in HA? Can you use the companion app when you’re not home? If not, that’s your problem.

post updated with YAML code. I think I did that right.

Ah so I could’ve just used a condition to check if I’m connected to the home network or not to determine if I’m home. If I went that route, then I could scratch the DuckDNS stuff but also lose any chance of getting a notification right? Honestly, I don’t actually need the notification, I just wanted to see if my task was working and also didn’t think about the Wi-Fi tracking option. I’m not too interested in having connection with my HA server away from home unless having remote access is the norm and I would regret it.

I have some thinking to do about this, I’m leaning towards no notification/ phone gps tracking and keeping things simple by using Wi-Fi tracking. But to answer your question, I do get a notification using the gps cheater. I can use the companion app when I am away, just not when I’m home. It’s probably something I did while setting up remote access. But I might scratch the remote access so no biggie.


sorry in advance if I did not use quotes properly and butchered this reply but the wheels are rolling on how to make improvements. Thanks!

1 Like

Good thinking, i’m going to implement the temp settings for more than a set amount of time trigger but only when I’m not on Wi-Fi (not home). That way my t-stat app can kick in and use the temp settings I have set throughout the day. I like it at 73 when I’m home and 70 while I sleep. I’m too lazy to do this with HA so I’ll let the t-stat app do it for me haha.

Of course, you could always go with …
Touch my thermostat and your day to get out of here just changed to … tomorrow!

But, this is always a good way to start with HA anyway. We have a good morning and good night script that set the temps up and down along with doing some other things.