I’m fairly new to Home Assistant. I have it set up and running well, and created several simple automations which works. However, I’m not sure how to combine on/off automations for the same device into one automation.
For example, I have a heating automation that triggers when a Sonoff temp/humidity sensor’s temperature value drops below a certain value. It then switches the heating on using a Sonoff ZBMINI. There’s a condition that it will only trigger during the day between set times.
Then I have a separate automation to do the opposite, to turn the heating off when temperature goes above a certain value.
I also have the same two automations for night time, set to trigger only between certain set times.
I would like to combine the two into one and I’m sure it’s perfectly doable, but it doesn’t work for some reason. My implementation is probably not correct.
Here’s my automations. How would I go about combining them into one? Ideally if I can combine the two daytime and two night time automations all into one that would be first prize, but I’m happy to have a daytime and night time automation separately to keep things simpler while I learn more about automations.
Heating ON - Day:
alias: Heating ON - Day
description: ''
trigger:
- type: temperature
platform: device
device_id: 3cf865edfc3fbd08e231b9da73c97d31
entity_id: sensor.temp_and_humid_sensor_01_temperature
domain: sensor
below: 16.5
condition:
- condition: time
after: '05:30:00'
before: '22:30:00'
action:
- type: turn_on
device_id: f3a06f130750f78b0d1aa71f27eef33d
entity_id: light.heating_switch_on_off
domain: light
mode: single
Heating OFF - Day
alias: Heating OFF - Day
description: ''
trigger:
- type: temperature
platform: device
device_id: 3cf865edfc3fbd08e231b9da73c97d31
entity_id: sensor.temp_and_humid_sensor_01_temperature
domain: sensor
above: 17.5
condition:
- condition: time
after: '05:30:00'
before: '22:30:00'
action:
- type: turn_off
device_id: f3a06f130750f78b0d1aa71f27eef33d
entity_id: light.heating_switch_on_off
domain: light
mode: single
Create the new automation triggering on the temperature sensor state and no value.
Leave condition blank.
Then in action, select choose. Here is where you now create a new ‘option’ for each of the previous automations. Each option gets a condition or multiple conditions (time, above, below, etc) and the appropriate action.
[edit] story time. I started using HA just like you. Every automation was separate because I didn’t know about choose. Now I have numerous automations with three or four options based on time, presence, state, etc. It’s a great feature.
You’ll want to look at the “Trigger ID” option in the triggers.
You set a “Trigger ID” for “On” or “Off” based on the specific trigger and then in the action use “Choose” and select your appropriate named trigger as the condition for the action.
I’ve merged a few automations from separate on or off automations into a singular automation with this method.
If I understand the generic thermostat correctly, in it’s simplest form I don’t need to even add an automation for it, it runs completely from the configuration.yaml settings, right?
So if I want to set certain times for it to run during the day/night I would create two different thermostats, one for day and one for night temperatures, and create an automation them to run them at certain times. Correct?
It would be better to use one thermostat and set with an automation. The away temp is used while your away. If user tracking set up you can use that with an automation to set the thermostat to away. I use my cell phone attaching to my wifi (ubiquity) to say whether we are home or away. With multiple people you just need to create a group and use the group sensor for home or away.
I use an automation to control my thermostats with varying temperatures during the week and weekend. @123 gave a lot of help on this.
So I set up the thermostat, and added the scheduler, very nifty thank you! Only problem is that my heating is not coming on when the temperature drops below the set value (1 degree Celsius below target temp).
The climate card does display the correct temperature sensor values so there’s no problem reading the value. The heating comes on if I switch it on manually through HA, so that works. It just seems like the thermostat is not triggered. I know where to debug automations, but I can’t find where/how to debug the thermostat.
As a test, I removed my scheduler setting and tested the thermostat on its own, but no luck.
Can you spot anything wrong in my config?