I am trying to create my first Blueprint. But I have a Problem with one of my conditions, I think .
I used this blueprint as a template to just add my stuff and change it so it works better with my Nest thermostat.
Here is my Blueprint:
blueprint:
name: Thermostat Control
description: Control your thermostat with options for group home, and heating between specific times.
domain: automation
input:
thermastat:
name: Thermastat Device
description: The Thermastat device to use.
selector:
entity:
domain: climate
group_presence:
name: Person Group
description: The group of people that have to be home.
default: []
selector:
entity:
domain: group
group_not_present_offset:
name: Not present offset
description: Set to Eco if Person of Group was not present for a given amount of time
default: 01:00:00
selector:
time: {}
heating_boolean:
name: Heating Boolean
description: Check if Boolean is on for automation
default: true
selector:
entity:
domain: input_boolean
hvac_mode:
name: HVAC Mode
description: Will run only if thermostat is in given HVAC mode.
default: heat
selector:
select:
options:
- heat
- cool
set_temp:
name: Temperature Target
description: Sets the thermostat to this temperature.
default: 20
selector:
number:
min: 10.0
max: 25.0
step: 0.5
mode: slider
eco_temp:
name: Energy Saving Temperature
description: When away, keep the Energy Saving Temperature
default: 17
selector:
number:
min: 14.0
max: 25.0
step: 0.5
mode: slider
time_after:
name: Time After
description: After this time the heating turns on, so it's warm in the morning
default: 07:30:00
selector:
time: {}
time_before:
name: Time Before
description: After this time the heating turns off, This to prevent the heating is on in the middle of the night
default: '21:30:00'
selector:
time: {}
# source_url: https://gist.github.com/f45tb00t/eab416909ff6d125d7f3c6170ab017a9
variables:
set_temp: !input 'set_temp'
eco_temp: !input 'eco_temp'
hvac_mode: !input 'hvac_mode'
trigger:
- platform: homeassistant
event: start
- platform: event
event_type: automation_reloaded
- platform: time_pattern
minutes: /5
- platform: device
domain: climate
entity_id: !input 'thermastat'
type: hvac_mode_changed
- platform: state
entity_id: !input 'heating_boolean'
to: 'on'
condition:
- condition: state
entity_id: !input 'heating_boolean'
state: 'on'
- condition: device
domain: climate
entity_id: !input 'thermastat'
type: is_hvac_mode
hvac_mode: '{{ hvac_mode }}'
- condition: time
after: !input 'time_after'
before: !input 'time_before'
action:
- choose:
- conditions:
- condition: state
entity_id: !input 'group_presence'
state: not_home
for: !input 'group_not_present_offset'
sequence:
- service: climate.set_temperature
target:
entity_id: !input 'thermastat'
data:
temperature: '{{ eco_temp }}'
default:
- service: climate.set_temperature
target:
entity_id: !input 'thermastat'
data:
temperature: '{{ set_temp }}'
and here is the error I get when I create an automation with this blueprint:
Logger: homeassistant.components.automation
Source: components/automation/init.py:638
Integration: Automation (documentation, issues)
First occurred: 12:00:04 (12 occurrences)
Last logged: 12:24:03
Blueprint Thermostat Control generated invalid automation with inputs OrderedDict(
[(âhvac_modeâ, âheatâ),
(âthermastatâ, âclimate.living_room_thermostatâ),
(âgroup_presenceâ, âgroup.somebodyâ),
(âheating_booleanâ, âinput_boolean.thermostat_autoâ),
(âset_tempâ, 22),
(âeco_tempâ, 18),
(âtime_afterâ, â07:45:00â)]
): required key not provided @ data[âconditionâ][1][âdevice_idâ]. Got None
I think, I need a âdevice_idâ in the condition with the type âdeviceâ but how do I get it from my input?
I want to check if the device (Nest thermostat) is in specific mode (heat, or cool) select variable âhvac_modeâ. And only if the device is in the selected mode it should turn the temperature based on presence and time.
In the blueprint I used as a template the thermostat was turned off and on by the automation, that doesnât work with Nest. With Nest thermostats you turn heating on once and you let it on until it is warm outside. You just adjust the temperature and the thermostat ist doing the rest by itself. But I want to set different temperatures during the day and at night. I also want to have different temperatures set if the thermostat mode changes to cool and therefore, I want to check the mode of the thermostat itself.
I would have 4 Automation
Heating during the day
Heating during the night
Cooling during the day
Cooling during the night
and when the Thermostat mode ist âoffâ it should do nothing.
I can create the whole automation without a blueprint, and it works but I wanted to do it with one and for this I had to remove the âdevice_idâ, because it wouldnât work for someone else if I would share it.
I wasnât really happy with the solution to convert all device conditions/triggers to state conditions/triggers.
Device conditions/triggers seem to be a bit friendlier and are more descriptive than state conditions/triggers making them easier to read and less likely to cause an error, so I found an alternative.
Use only one input which gets the entity_id (in this case, called âmotion_entityâ):
input:
motion_entity:
name: Motion Sensor
description: This is the motion sensor used by the blueprint
selector:
entity:
domain: binary_sensor
device_class: motion
Then use a function to get the device_id from the entity_id whenever you need to specify the device_id.
@riedlp This is not really related to the prior. I would suggest creating a new topic and provide some context. Some of your code and the error you are getting. There is not enough information here to form an answer.