I am currently fiddling with ESPHome and liking it so far.
I have an AC unit that is controlled by IR. I am configuring an esp8266 device that has IR transmitter and IR receiver to control the AC unit. Everything seems to work as expected besides one thing. I am having a little issue with the possible situation of a power outage.
I have set, in the thermostat climate controller, the following values :
default_preset : to one of my presets
on_boot_restore_from : to memory
startup_delay : to true
I did some testing and these are my findings :
If the esp8266 board is properly rebooted, then it correctly restores to previous state
If I cut the power to the esp8266 board (simulating a power outage), on powering it on again, it correctly starts on the default preset
Unfortunately, each time, on power on, the esp8266 board sends some IR signals to the AC unit that first turns it off, then applies the previous state or default preset (so if necessary it turns it on again).
The problem is the following :
When I really had power outages in the past and power came back, the AC was restoring the state it was in. This being, if it was on before the outage, it will turn on when the power comes back.
My main concern is that, when power is back, if the esp8266 board boots quicker than the AC unit, it would send the IR signal to turn it off (which the unit may not receive), then apply the default preset. If, once applying the default preset, the AC doesn’t need to be on, it will simply not do any action. But the AC will be on in that case, so there will be a fail in the state sync.
I thought the startup_delay would prevent the esp8266 board from sending any IR signals during the min_cooling_off_time (which is set to 60s), but it doesn’t seem to be true.
I also tried an on_boot command (with different levels of priority) with a delay time to prevent the esp8266 board from sending the off IR signal right away, but it was useless.
Do you know how I can delay the off IR signal sent on boot?
Or maybe there is a better way to resolve this?
So there is nothing that can delay those off IR signals sent at boot?
I am not sure to understand the question.
If I don’t set any default preset, then in case of power outage, what will happen? The thermostat will be off? If yes, this could not be the desired state, as maybe before the power outage it was on/idle, and I would rather have it load a preset that turns the thermostat on (even if it will be idle and not actively cooling), but if the temperature goes beyond a threshold, it will start cooling.
There might be, I don’t have personally experience with Thermostat. I usually build automations with “basic components”. But like you noticed, the documentation didn’t offer clear option. Also, you haven’t posted any code yet to see your setup.
According to documentation it should “do something”:
startup_delay (Optional, boolean): If set to true, when ESPHome starts, min_cooling_off_time, min_fanning_off_time, and min_heating_off_time must elapse before each respective action may be invoked. This option provides a way to prevent damage to equipment (for example) disrupted by a power interruption. Defaults to false.
If you can’t make it working, try to delay the whole esphome on boot.
Already tried, but I did it again with exactly the code you sent, and the result is the same (the board sends the IR off signal to the AC unit upon boot).
Thinking about it, I realized that the startup_delay variable is defined in the thermostat part. I also have a part where I defined the IR climate. I think this is the part that sends the IR off signal, not the thermostat part. So the startup_delay variable is useless in this case, as it has to do with the thermostat not the IR.
But this is all suppositions as I don’t know how I could check this.
I know I can see the logs through ESPHome Web Interface (if this is what you are referring to), but the board sends the IR off signal way before any log is displayed there.
So I think that the only solution to see what is happening at boot is through a serial connection.
Ahh, true. I didn’t “connect” with this topic…
By the way, what would happen if this “problem transmission” was obscured ?
For example IR emitter disabled.
Can’t really do that, as the Climate IR needs it and the firmware doesn’t compile without the IR transmitter.
I think I don’t have a choice, I will have to use a serial connection.
But thanks for all your inputs since a few days.
You haven’t posted your hardware, neither code.
I ask, what would be the output with your setup if IR emitter was not powered on at boot but just after?
If it’s just LED without transistor circuit, you can supply/switch GND through GPIO pin (resistor in series with LED is still needed). But that doesn’t delay the first signal, it completely cancel it. That’s why I was asking…
I managed to get a serial to usb.
But I am not sure how to read the logs from the board.
I tried to connect RX to TX, TX to RX and powered on the board.
Did a tail -f /dev/ttyUSB0 but nothing was showing on the terminal.
This is without any presets defined.
What it seems to me is that the climate component is setting the IR and Thermostat and fires the IR commands at boot.
When presets are defined, but no default preset is defined, I get the following message
<0x1b>[0;33m[W][climate:085]: Preset NONE is not supported by this device!<0x1b>[0m<0xed><0xeb><0xdb>[<0xbf><0xbb><0xb7>[ku][{omm
When presets are defined and my default preset is named startup