I recently got the idea to start using packages to combine all my “project” related items. So in my configuration.yaml I added the following according to the example:
homeassistant:
packages: !include_dir_merge_named yaml/projects/
Then I started my first item in a subfolder in the projects folder: devices/schuurkoelkast.yaml
device_schuurkoelkast_package:
sensor:
# Logbook sensor
- platform: template
sensors:
logbook_koelkast:
friendly_name: "Logbook Koelkast"
value_template: >-
{% set Koelkast = [
"sensor.logbook_koelkast",
]%}
{{
expand(Koelkast)
|list()|count()
}}
unit_of_measurement: "Entities"
input_boolean:
# Fridge on/off boolean
- koelkast_schuur:
name: Koelkast schuur
icon: mdi:fridge
automation:
# Turn fridge on
- id: koelkastschuuraan
alias: "Koelkast schuur aan"
trigger:
- platform: numeric_state
entity_id: sensor.koelkast_schuur_power
above: '5'
condition:
- condition: template
value_template: '{{ states.input_boolean.koelkast_schuur.state != "on" }}'
action:
- service: input_boolean.turn_on
entity_id: input_boolean.koelkast_schuur
# Turn fridge off
- id: koelkastschuuruit
alias: "Koelkast schuur uit"
trigger:
- platform: numeric_state
entity_id: sensor.koelkast_schuur_power
below: '6'
condition:
- condition: template
value_template: '{{ states.input_boolean.koelkast_schuur.state != "off" }}'
action:
- service: input_boolean.turn_off
entity_id: input_boolean.koelkast_schuur
utility_meter:
# Daily Energy calculation
- schuurkoelkast_daily_energy:
source: sensor.koelkast_schuur_energy
name: Koelkast Schuur Dagelijkse Energie
cycle: daily
tariffs:
- peak
- offpeak
template:
- sensors:
# Energy costs today
schuurkoelkast_cost_today:
friendly_name: "Koelkast Schuur kosten vandaag"
unit_of_measurement: '€'
value_template: "{{ (states('sensor.schuurkoelkast_daily_energy_peak') | float * 0.225 + states('sensor.schuurkoelkast_daily_energy_offpeak') | float * 0.20709) | round(2) }}"
# Energy usage today
schuurkoelkast_daily_kwh:
friendly_name: "Koelkast Schuur verbruik vandaag"
unit_of_measurement: kWh
value_template: "{{( states('sensor.schuurkoelkast_daily_energy_offpeak')|float + states('sensor.schuurkoelkast_daily_energy_peak')|float) | round(2) }}"
# Energy usage yesterday
schuurkoelkast_yesterday_kwh:
friendly_name: "Koelkast Schuur verbruik gister"
unit_of_measurement: kWh
value_template: "{{ (state_attr('sensor.schuurkoelkast_daily_energy_offpeak','last_period')|float + state_attr('sensor.schuurkoelkast_daily_energy_peak','last_period')|float )| round(2)}}"
This all sounded good in theory, but when I check the code I get the following errors:
Package device_schuurkoelkast_package setup failed. Component input_boolean cannot be merged. Expected a dict.
Package device_schuurkoelkast_package setup failed. Component utility_meter cannot be merged. Expected a dict.
So it seems the sensor and automation parts work fine, but the input_boolean and utility_meter dont work. What am I doing wrong here?