19
submitted 10 months ago* (last edited 10 months ago) by peregus@lemmy.world to c/homeassistant@lemmy.world

I'm pretty new to HA. I've set it up and I keep editing the confirmation and everytime I restart to apply the changes, all the switches, sensors and even the thermostat lose their values. The most annoying is the thermostat (classic thermostat entity) because I have to turn it on selecting heat/cool and set the temperature. Is there a way to keep all these values across restarts?

Edit: I'm using HA OS on Proxmox. All the sensors and switches slowly goes back to "normal" as soon as they publish their state, apart from some entities that have values provided by HA itself and not by the devices (like the thermostat).

you are viewing a single comment's thread
view the rest of the comments
[-] DeltaTangoLima@reddrefuge.com 1 points 10 months ago

How network-savy are you? I'm thinking you could run tcpdump on your HA server and capture network packets while restarting HA, then inspect in Wireshark.

Most devices don't actually "send" their status to HA directly. It'll (usually) be HA querying their status (the exception being devices that publish via intermediate services, like MQTT). Inspecting the network packets might reveal more about what's going on.

[-] peregus@lemmy.world 1 points 10 months ago

All the devices (sensors and switches )sends their status via MQTT; I've manually configured them all via yaml. The problem is in HA itself since as soon as I reload the config, the thermostat (which is a HA entity by itself), loses the setpoint and the status (heater/cool/off).

[-] tom_bombadil@mastodon.social 1 points 10 months ago

@peregus @DeltaTangoLima I am not an expert by any means, but I think there is a state "recall" somewhere that tells mqtt and or ha to keep last state

[-] peregus@lemmy.world 1 points 10 months ago

For MQTT that's the retain flag, but for HA I don't know what that is and I really need it!!!

[-] DeltaTangoLima@reddrefuge.com 1 points 10 months ago

The retained flag simply tells the MQTT broker to keep the last message published for that topic, so it's always available (rather than timing out and emptying the topic).

Like I said, you should probably do a packet capture to see what's happening when HA queries states (either from devices or MQTT - it doesn't matter).

[-] peregus@lemmy.world 1 points 10 months ago

HA doesn't query any state. The thermostat is within HA, it doesn't have to query anything from anything, that's what I'm investigating. The setpoint is set in HA and HA retains that number.

[-] DeltaTangoLima@reddrefuge.com 0 points 10 months ago

That doesn't make sense. HA doesn't "own" the setpoint - the physical thermostat does. All HA is doing is telling the thermostat what setpoint to use, as if you were standing in front of the thermostat yourself.

What thermostat are you using?

[-] peregus@lemmy.world 1 points 10 months ago

The thermostat is an entity in HA, there is no phisical thermostat! It's a generic thermostat!

[-] DeltaTangoLima@reddrefuge.com 0 points 10 months ago

Ah, so your real issue is just the thermostat? Your OP made it sound like you were asking about all switches and sensors.

Is it just the setpoint that you're losing and not getting back after restart? I'm assuming it's getting the current temp back from the sensor just fine?

[-] peregus@lemmy.world 1 points 10 months ago

No, my problem is not just the thermostat! All the sensors and switches loses their state, but while they get them back in a while kapart from the battery powered sensors), the thermostat has to be set back manually.

[-] DeltaTangoLima@reddrefuge.com 0 points 10 months ago

Jesus, you're not exactly making it easy here mate. Feeding info piecemeal, to someone who's spending time to try and help you, only frustrates both of us.

Re the sensors and switches, you said they're all sending states via MQTT. Are they setting the retained flag? If not, that's the problem. If so, run a packet capture to see what's happening when HA restarts - maybe it's not querying MQTT successfully straight away or something.

Re your thermostat, can you post your config? There's a few threads on the HA community forums that are complaining of similar issues, with various causes/solutions discussed.

[-] peregus@lemmy.world 1 points 10 months ago

I'm sorry if you think that I'm wasting your time. From my point of view, it's the other way around since all it's written in the OP! And you still saying to run a packet capture means you didn't get the point or you know HA less than me!

[-] DeltaTangoLima@reddrefuge.com 0 points 10 months ago

means you didn’t get the point or you know HA less than me

Your OP says "everytime I restart to apply the changes, all the switches, sensors and even the thermostat lose their values". Later on, you've said that you configured all your switches and sensors to publish their states in MQTT. Hence why I'm saying you need to look at how and when HA is querying those states.

You've since clarified that the thermostat is a generic thermostat entity, where HA controls setpoint. Without having posted your config, I'm left to assume that HA turns your HVAC on/off based on a temp sensor state.

I've been running HA for many, many years, and am a network guy by trade. I'm only trying to help, but you're now assuming I'm either not getting the point or know less than you.

No worries, mate. Best of luck. 👍

this post was submitted on 14 Nov 2023
19 points (100.0% liked)

homeassistant

11833 readers
6 users here now

Home Assistant is open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server. Available for free at home-assistant.io

founded 1 year ago
MODERATORS