I just started learning about packages. I want to define helpers (including timers), templates and automations.
Sadly the Packages documentation lacks a list of exactly what you can include and examples of how to do it. The implication is that you can define anything that you could define under the homeassistant:
key in configuration.yaml
and input_boolean
is mentioned in passing – I assumed that if you can define them, you can also define input_number
, input_text
, and timer
.
However, when I tried it with some test code, I got configuration warnings (that look rather like errors)
Configuration warnings
Setup of package ‘heating_x2_definitions’ failed: integration ‘input_number’ cannot be merged, expected a dict
Setup of package ‘heating_x2_definitions’ failed: integration ‘input_text’ cannot be merged, expected a dict
Setup of package ‘heating_x2_definitions’ failed: integration ‘timer’ cannot be merged, expected a dict
Is that because they are not supported, or did I just get the syntax wrong?
###
### ZZZ Test room heating control
###
input_number:
- zzz_test_room_heating_manual_temperature:
name: ZZZ Test room heating manual temperature
min: 0
max: 100
step: 0.5
mode: box
icon: mdi:temperature-celsius
- zzz_test_room_heating_required_temperature:
name: ZZZ Test room heating required temperature
min: 0
max: 100
step: 0.5
mode: box
icon: mdi:temperature-celsius
input_text:
- zzz_test_room_heating_setting_reason:
name: ZZZ Test room heating setting reason
initial: “”
icon: mdi:card-text-outline
timer:
- zzz_test_room_heating_manual_override_timer:
name: ZZZ Test room heating manual override timer
duration: "00:00:00"
restore: true
icon: mdi:av-timer
- zzz_test_room_heating_warmup_timer:
name: ZZZ Test room heating warmup timer
duration: "00:00:00"
restore: true
icon: mdi:av-timer
- zzz_test_room_heating_door_or_window_open_timer:
name: ZZZ Test room heating door or window open timer
duration: "00:00:00"
restore: true
icon: mdi:av-timer
- zzz_test_room_heating_room_unoccupancy_timer:
name: ZZZ Test room heating room unoccupancy timer
duration: "00:00:00"
restore: true
icon: mdi:av-timer
- zzz_test_room_heating_echoblock_timer:
name: ZZZ Test room heating echoblock timer
duration: "00:00:00"
restore: true
icon: mdi:av-timer
template:
- sensor:
- name: ZZZ Test room west TRV set temperature
unique_id: zzz_test_room_west_trv_set_temperature
unit_of_measurement: 'C'
icon: mdi:thermometer
state: "{{ state_attr('climate.zzz_test_room_west_trv', 'temperature') }}"
- sensor:
- name: ZZZ Test room west TRV measured temperature
unique_id: zzz_test_room_west_trv_measured_temperature
unit_of_measurement: 'C'
icon: mdi:thermometer
state: "{{ state_attr('climate.zzz_test_room_west_trv', 'current_temperature') }}"
- binary_sensor:
- name: ZZZ Test room west TRV heat demand
unique_id: zzz_test_room_west_trv_heat_demand
icon: mdi:heat-wave
state: "{{ float(state_attr('climate.zzz_test_room_west_trv, 'temperature'),0) > float(state_attr('climate.zzz_test_room_west_trv, 'current_temperature'),99) }}"
automation:
- id: zzz_test_room_heating_control
alias: ZZZ Test room heating control
description: Controls the heating for the ZZZ Test room using the ZZZ Test room heating schedule calendar
use_blueprint:
path: AndySymons/heating_x2.yaml
input:
thermostat_controls:
- zzz_test_room_west_trv
- zzz_test_room_east_trv
away_switch: input_boolean.away
door_or_window_open_sensors: []
room_occupancy_sensors: []
room_calendar: calendar.zzz_test_room_heating_schedule
manual_temperature: input_number.zzz_test_room_heating_manual_temperature
required_temperature: input_number.zzz_test_room_heating_required_temperature
setting_reason: input_text.zzz_test_room_heating_setting_reason
door_or_window_open_timer: timer.zzz_test_room_heating_door_or_window_open_timer
unoccupancy_timer: timer.zzz_test_room_heating_room_unoccupancy_timer
warmup_timer: timer.zzz_test_room_heating_warmup_timer
manual_override_timer: timer.zzz_test_room_heating_manual_override_timer
echoblock_timer: timer.zzz_test_room_heating_echoblock_timer
minimum_thermostat_temperature: 5
maximum_thermostat_temperature: 30
away_temperature: 5
background_temperature: 5
door_or_window_open_period: 00:02:00
unoccupancy_period: 00:30:00
warmup_period: 02:00:00
manual_override_period: 02:00:00
After reloading the configuration anyway, there were (predictably) no helpers, the template sensors look OK and the automation is generated but ‘unavailable’ and cannot be edited from the UI.