When I restart HA I get the following error.
How do I stop this?
Post your configuration.yaml
default_config:
frontend:
themes: !include_dir_merge_named themes
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
template:
binary_sensor:
name: octopus_agile_plunge_target
unique_id: x68_a0t_7t1
state: “{{ (states(‘sensor.octopus_energy_electricity_xxxx_yyyy_current_rate’) | float(0)) < 0.0 }}”
sensor:
name: “Kettle SM1 Power”
unit_of_measurement: “W”
unique_id: “custom_live_Kettle SM1_power”
device_class: power
state: >-
{% set power = (state_attr(‘switch.Kettle SM1’, ‘current_consumption’) | float(0)) %}
{{power}}
name: “Kettle SM1 Current”
unit_of_measurement: “A”
unique_id: “custom_live_Kettle SM1_current”
device_class: current
state: >-
{% set current = ((state_attr(‘switch.Kettle SM1’, ‘current’) | float(0)) / 1000) | round(2) %}
{{current}}
name: “Kettle SM1 Voltage”
unit_of_measurement: “V”
unique_id: “custom_live_Kettle SM1_voltage”
device_class: voltage
state: >-
{% set voltage = (state_attr(‘switch.Kettle SM1’, ‘voltage’) | float(0)) %}
{{voltage}}
name: “Tumble Drier SM2 Power”
unit_of_measurement: “W”
unique_id: “custom_live_Tumble Drier SM2_power”
device_class: power
state: >-
{% set power = (state_attr(‘switch.Tumble Drier SM2’, ‘current_consumption’) | float(0)) %}
{{power}}
name: “Tumble Drier SM2 Current”
unit_of_measurement: “A”
unique_id: “custom_live_Tumble Drier SM2_current”
device_class: current
state: >-
{% set current = ((state_attr(‘switch.Tumble Drier SM2’, ‘current’) | float(0)) / 1000) | round(2) %}
{{current}}
name: “Tumble Drier SM2 Voltage”
unit_of_measurement: “V”
unique_id: “custom_live_Tumble Drier SM2_voltage”
device_class: voltage
state: >-
{% set voltage = (state_attr(‘switch.Tumble Drier SM2’, ‘voltage’) | float(0)) %}
{{voltage}}
name: “Microwave SM3 Power”
unit_of_measurement: “W”
unique_id: “custom_live_Microwave SM3_power”
device_class: power
state: >-
{% set power = (state_attr(‘switch.Microwave SM3’, ‘current_consumption’) | float(0)) %}
{{power}}
name: “Microwave SM3 Current”
unit_of_measurement: “A”
unique_id: “custom_live_Microwave SM3_current”
device_class: current
state: >-
{% set current = ((state_attr(‘switch.Microwave SM3’, ‘current’) | float(0)) / 1000) | round(2) %}
{{current}}
name: “Microwave SM3 Voltage”
unit_of_measurement: “V”
unique_id: “custom_live_Microwave SM3_voltage”
device_class: voltage
state: >-
{% set voltage = (state_attr(‘switch.Microwave SM3’, ‘voltage’) | float(0)) %}
{{voltage}}
recorder:
purge_keep_days: 365
resources:
- url: /local/apexcharts-card.js?v=2.0.4
type: module
- url: /local/power-flow-card-plus.js
type: module
I don’t think resources belong in configuration.yaml.
Have a look at Settings | Dashboards and click the three dots in the top right-hand corner.
You need to format your code properly, though.
please use code tags to make the code properly formatted.
How to help us help you - or How to ask a good question - Configuration - Home Assistant Community (home-assistant.io)
# Loads default set of integrations. Do not remove.
default_config:
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
template:
- binary_sensor:
name: octopus_agile_plunge_target
unique_id: x68_a0t_7t1
state: "{{ (states('sensor.octopus_energy_electricity_xxxx_yyyy_current_rate') | float(0)) < 0.0 }}"
sensor:
- name: "Kettle SM1 Power"
unit_of_measurement: "W"
unique_id: "custom_live_Kettle SM1_power"
device_class: power
state: >-
{% set power = (state_attr('switch.Kettle SM1', 'current_consumption') | float(0)) %}
{{power}}
- name: "Kettle SM1 Current"
unit_of_measurement: "A"
unique_id: "custom_live_Kettle SM1_current"
device_class: current
state: >-
{% set current = ((state_attr('switch.Kettle SM1', 'current') | float(0)) / 1000) | round(2) %}
{{current}}
- name: "Kettle SM1 Voltage"
unit_of_measurement: "V"
unique_id: "custom_live_Kettle SM1_voltage"
device_class: voltage
state: >-
{% set voltage = (state_attr('switch.Kettle SM1', 'voltage') | float(0)) %}
{{voltage}}
- name: "Tumble Drier SM2 Power"
unit_of_measurement: "W"
unique_id: "custom_live_Tumble Drier SM2_power"
device_class: power
state: >-
{% set power = (state_attr('switch.Tumble Drier SM2', 'current_consumption') | float(0)) %}
{{power}}
- name: "Tumble Drier SM2 Current"
unit_of_measurement: "A"
unique_id: "custom_live_Tumble Drier SM2_current"
device_class: current
state: >-
{% set current = ((state_attr('switch.Tumble Drier SM2', 'current') | float(0)) / 1000) | round(2) %}
{{current}}
- name: "Tumble Drier SM2 Voltage"
unit_of_measurement: "V"
unique_id: "custom_live_Tumble Drier SM2_voltage"
device_class: voltage
state: >-
{% set voltage = (state_attr('switch.Tumble Drier SM2', 'voltage') | float(0)) %}
{{voltage}}
- name: "Microwave SM3 Power"
unit_of_measurement: "W"
unique_id: "custom_live_Microwave SM3_power"
device_class: power
state: >-
{% set power = (state_attr('switch.Microwave SM3', 'current_consumption') | float(0)) %}
{{power}}
- name: "Microwave SM3 Current"
unit_of_measurement: "A"
unique_id: "custom_live_Microwave SM3_current"
device_class: current
state: >-
{% set current = ((state_attr('switch.Microwave SM3', 'current') | float(0)) / 1000) | round(2) %}
{{current}}
- name: "Microwave SM3 Voltage"
unit_of_measurement: "V"
unique_id: "custom_live_Microwave SM3_voltage"
device_class: voltage
state: >-
{% set voltage = (state_attr('switch.Microwave SM3', 'voltage') | float(0)) %}
{{voltage}}
# Database
recorder:
purge_keep_days: 365
resources:
- url: /local/apexcharts-card.js?v=2.0.4
type: module
- url: /local/power-flow-card-plus.js
type: module
http:
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem
http:
use_x_forwarded_for: true
trusted_proxies:
- 172.30.33.0/24
Install the missing integration.
Look in settings → integrations to see which is missing. It’s either apexcharts-card or power-flow-card-plus.
maybe try this… i nuked the resources stuff out of configuration.yaml. don’t think it belongs there. where did you get info that recommended doing that?
i also nuked the ssl_cert stuff becuase that was also formatted incorrectly. if you do have ssl setup and want to use it, see below…
# Loads default set of integrations. Do not remove.
default_config:
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
template:
- binary_sensor:
name: octopus_agile_plunge_target
unique_id: x68_a0t_7t1
state: "{{ (states('sensor.octopus_energy_electricity_xxxx_yyyy_current_rate') | float(0)) < 0.0 }}"
sensor:
- name: "Kettle SM1 Power"
unit_of_measurement: "W"
unique_id: "custom_live_Kettle SM1_power"
device_class: power
state: >-
{% set power = (state_attr('switch.Kettle SM1', 'current_consumption') | float(0)) %}
{{power}}
- name: "Kettle SM1 Current"
unit_of_measurement: "A"
unique_id: "custom_live_Kettle SM1_current"
device_class: current
state: >-
{% set current = ((state_attr('switch.Kettle SM1', 'current') | float(0)) / 1000) | round(2) %}
{{current}}
- name: "Kettle SM1 Voltage"
unit_of_measurement: "V"
unique_id: "custom_live_Kettle SM1_voltage"
device_class: voltage
state: >-
{% set voltage = (state_attr('switch.Kettle SM1', 'voltage') | float(0)) %}
{{voltage}}
- name: "Tumble Drier SM2 Power"
unit_of_measurement: "W"
unique_id: "custom_live_Tumble Drier SM2_power"
device_class: power
state: >-
{% set power = (state_attr('switch.Tumble Drier SM2', 'current_consumption') | float(0)) %}
{{power}}
- name: "Tumble Drier SM2 Current"
unit_of_measurement: "A"
unique_id: "custom_live_Tumble Drier SM2_current"
device_class: current
state: >-
{% set current = ((state_attr('switch.Tumble Drier SM2', 'current') | float(0)) / 1000) | round(2) %}
{{current}}
- name: "Tumble Drier SM2 Voltage"
unit_of_measurement: "V"
unique_id: "custom_live_Tumble Drier SM2_voltage"
device_class: voltage
state: >-
{% set voltage = (state_attr('switch.Tumble Drier SM2', 'voltage') | float(0)) %}
{{voltage}}
- name: "Microwave SM3 Power"
unit_of_measurement: "W"
unique_id: "custom_live_Microwave SM3_power"
device_class: power
state: >-
{% set power = (state_attr('switch.Microwave SM3', 'current_consumption') | float(0)) %}
{{power}}
- name: "Microwave SM3 Current"
unit_of_measurement: "A"
unique_id: "custom_live_Microwave SM3_current"
device_class: current
state: >-
{% set current = ((state_attr('switch.Microwave SM3', 'current') | float(0)) / 1000) | round(2) %}
{{current}}
- name: "Microwave SM3 Voltage"
unit_of_measurement: "V"
unique_id: "custom_live_Microwave SM3_voltage"
device_class: voltage
state: >-
{% set voltage = (state_attr('switch.Microwave SM3', 'voltage') | float(0)) %}
{{voltage}}
# Database
recorder:
purge_keep_days: 365
http:
use_x_forwarded_for: true
trusted_proxies:
- 172.30.33.0/24
to keep the ssl stuff try this http section:
http:
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem
use_x_forwarded_for: true
trusted_proxies:
- 172.30.33.0/24
obviously i’m not testing it on my config, so just eyeballing it… buyer beware… no refunds…
Thanks for the suggestions.
Hashed out the resources for apex charts and power flow and all good, they still work so don’t know why they were there.
Having trouble though with the ssl entries. Cant get them to save, must be an indent problem but cant get it right. Also not sure what they are for. I have them hashed out and will see what stops working.
Your template
section is messy and inconsistent. Might be actually wrong but hard to say. Set it up thus:
template:
- binary_sensor:
- name: octopus_agile_plunge_target
[everything else at this indentation level]
- sensor:
- name: "Kettle SM1 Power"
[everything else at this indentation level]
- name: "Kettle SM1 Current"
[everything else at this indentation level]
You have a lot of templates like this:
state: >-
{% set voltage = (state_attr('switch.Tumble Drier SM2', 'voltage') | float(0)) %}
{{voltage}}
I can’t believe that works at all: the entity ID should be something like switch.tumble_drier_sm2
(no caps or spaces); and you could simplify it to:
state: "{{ state_attr('switch.tumble_drier_sm2', 'voltage') }}"
the ssl entries are if you want home assistant to connect via https. however head of that you need to create the proper certs and put them in the specified locations. if you haven’t done that, then they should be left off. curious tho that they are not there by default, so at some point you or someone else intentionally added them?
I have done the certificate, but don’t know if they are in the proper location.
I followed the “speak to the geek” tutorial, if worked initially but won’t now, so maybe changing the configuration.yaml is what broke it.