I have a pellet stove attached to HA, the problem is, if the Nest HVAC state is already on “heat” the below automation does not trigger. But wait! If I turn down the Nest in order to get HVAC state to ‘off’ and then turn up the knob to engage ‘heat’, well, it works! Can I find the current state and change it accordingly instead of wait for a state change?
You may call it a “problem” but that’s precisely how a State Trigger works. It triggers when it detects a state-change. If there’s no change of state, there’s no trigger.
Maybe you need to use something other than a State Trigger, or possible even some other entity. I may be able to help you if you explain what it is you are trying to achieve with an automation.
This automation needs to be turned ON before the state change happens. Alternately, whatever turns the automation on can also call “automation.trigger” on it after turning it on. But, since all this does is turn on a switch if a condition is met, you could just do that in whatever turned this on in the first place.
I believe the key issue here is that the wrong entity is being monitored. It would appear the sensor reports the HVAC system’s operation mode. The mode represents what the HVAC can do (heat) and not what it is currently doing (heating or idle).
Your automation needs to monitor the entity that reports when the HVAC system is actively heating. Because that sensor’s state will toggle between heating and idle (or whatever two states representing heating or waiting). In other words, the automation needs to detect the “call for heat” event. Then it can activate the switch that, and I’m guessing here, releases the pellets.
Thank you for your reply, so I have these sensors exposed by Nest:
sensor.casa_eta (estimated time to reach the temperature target)
sensor.casa_thermostat_operation_mode (states off, heat, eco, for eg. if the temperaure is reached it remains on "heat", it is just the operation mode)
sensor.casa_thermostat_target (this is the temperature target setting)
sensor.casa_thermostat_temperature (actual temperature)
sensor.casa_thermostat_hvac_state (the one I'm using, this turns from "off" to "heat" when the Nest activate the primary relay (that is connected to the central heating)
The problem: When in the middle season, the central heating is turned off or better, is wood powered, so no heat from it, then I want Nest, with its timers and temperature settings, engage the pellet stove in the same way. The only sensor exposed by Nest that change state to “heat” is
“sensor.casa_thermostat_hvac_state” and the primary relay follow it, so I think is the correct sensor to check.
Scenario: the Nest have it’s program, it turns ON at 7:00 with temperature 23°C by itself, but at 10.00 I’m at home and feel cold, so I go to HA and turn on the automation, since “sensor.casa_thermostat_hvac_state” is already on “heat”, no state change happens, and the pellet stove remains off. The temporary solution is to turn OFF Nest and Turn it ON again (not so cool), to force the state change and trigger the automation.
I there a way to check the current state, instead of trigger the state change?
You’re right, there are two entities for this job, but I think I used the correct one (See my last post) seems that HA detects only state change and not evaluate the current state, neither when the automation is turned ON, maybe I’m interpeting it wrong.
The pellet stove is just a weak replacement (or booster) of the central heating, and since it needs maintenhance (cleaning every day, refilling) is better to have a separate switch to turn it on.
Can you set a Boolean switch to confirm you have carried out maintenance and use that as a condition?
Then as long as it’s been maintained since last use it will come on automatically
Sounds better than realising it’s already too cold?
You only want the wood stove on when the HVAC is actively heating. And also only when it’s been cleaned recently. Therefore, you should have one automation that is on all the time that turns on the wood stove whenever the hvac is heating. You should have another automation that turns off the wood stove when the either the hvac is not heating or when the input_boolean.wood_stove_cleaned turns off. Then you need a 3rd automation that turns off the input_boolean.wood_stove_cleaned after it’s been on for 24 hours (or whatever time is appropriate). So, when you clean the stove, you turn the input boolean on (or press a button by the stove with an automation that turns the boolean on for you).
Since I don’t have a wood stove, I don’t know exactly how to use one. You may not want to turn it off every time the HVAC heating turns off. Or, you may want it to be on even when the heating is off. In this case, a generic_thermostat (along with the input_boolean.wood_stove_cleaned) may be what you want. Also, you may not need to clean the wood stove after 24 hours. Maybe it’s only needed after 24 hours of USE. In which case, you may need a “history_stats” sensor to tell you when you’ve actually used it for 24 hours.
Based on the scenario you’ve provided, you’re using the pellet stove as a booster. It’s used to augment the existing heating system controlled by the Nest thermostat. I’m not sure how you can automate something that you activate at your discretion.
On the other hand, if you want it to always turn on when hvac_state is heat, your automation appears to work opposite to what you want. When hvac_state is heat, it’s turning the pellet stove off.
{% if is_state('sensor.casa_thermostat_hvac_state', 'heat') %}
homeassistant.turn_off
Right now you say that you “notice it’s too cold and want to turn on the pellet stove” (or something to that effect). I’m assuming that you “notice that it’s too cold” because the temperature is too low even tho the Nest heat system is actively heating?
So why couldn’t you use the actual temperature to tell the pellet stove to come on?
For example, you could use a trend binary sensor (or something similar - I’ve never used it so I’m not exactly sure if that would work) to detect that the temperature is either lowering or at least not rising and use that as a trigger then check in the conditions that Nest is in heat mode then allow the action to turn on the pellet stove.
I haven’t fully thought out the details but I just figured I’d throw this out there as quick and dirty idea on which direction to go.
stove electronics need an inverted logic ambient temperature thermostat so open switch (off) = “heat”, close = “standby”
Thank you very much for all the proposed ideas, I’ll think about that.
My question is, does an HA automation triggers only on state change when turned on? If is this the logic HA works, is there a way I can turn on an automation and force it to revaluate the real current state of the entity instead of wait for a state change?