Hi,
All my custom sensor have disappeared.
It’s not that they show an error, they straight up does not load. Any sensors from helpers, using the customer templated sensors, just show ‘unavailable’.
Until recently they all worked just fine, and have been for months. Then they didn’t. I have not made any changes in the config.
Running supervised HA in a virtual machine, latest updates (updating and restarting have not helped).
My template setup:
#### TEMPLATES ####
template:
- sensor:
#POWER CALCULATIONS:
##Outputs the power user by the wall connector in W
- name: "Tesla Wall Connector Power"
state_class: "measurement"
unit_of_measurement: "W"
icon: mdi:battery-charging
state: "{{ (((states.sensor.tesla_wall_connector_phase_a_voltage.state | float) * states.sensor.tesla_wall_connector_phase_a_current.state | float) + ((states.sensor.tesla_wall_connector_phase_b_voltage.state | float) * states.sensor.tesla_wall_connector_phase_b_current.state | float) + ((states.sensor.tesla_wall_connector_phase_c_voltage.state | float) * states.sensor.tesla_wall_connector_phase_c_current.state | float)) | round(0) }}"
##Outputs the power user by the wall connector in kW
- name: "Tesla Wall Connector Power kW"
state_class: "measurement"
unit_of_measurement: "kW"
icon: mdi:battery-charging
state: "{{ ((((states.sensor.tesla_wall_connector_phase_a_voltage.state | float) * states.sensor.tesla_wall_connector_phase_a_current.state | float) + ((states.sensor.tesla_wall_connector_phase_b_voltage.state | float) * states.sensor.tesla_wall_connector_phase_b_current.state | float) + ((states.sensor.tesla_wall_connector_phase_c_voltage.state | float) * states.sensor.tesla_wall_connector_phase_c_current.state | float)) / 1000) | round(0) }}"
##Total number of kWh used by the Wall Connector to date
- name: "Tesla Wall Connector Energy kWh"
state_class: "measurement"
unit_of_measurement: "kWh"
icon: mdi:ev-station
state: "{{ states('sensor.tesla_wall_connector_energy') | float / 1000 | round(2) }}"
#COST CALCULATIONS:
#Outputs the NET DKK spent by the wall connector in DKK
- name: "Tesla Wall Connector Money Spent DKK brutto"
state_class: "measurement"
unit_of_measurement: "DKK"
icon: mdi:cash-100
state: "{{ (states('sensor.tesla_wall_connector_monthly_energy_kwh') | float * (state_attr('sensor.energi_data_service', 'current_price') | float)) | round(2) }}"
#Outputs the DKK spent by the wall connector in DKK after deduction of the TAX Cash Back
- name: "Tesla Wall Connector Money Spent DKK netto"
state_class: "measurement"
unit_of_measurement: "DKK"
icon: mdi:cash-100
state: "{{ (states('sensor.tesla_wall_connector_monthly_energy_kwh') | float * (state_attr('sensor.energi_data_service', 'current_price')-0.86 | float)) | round(2) }}"
#Outputs the Tax Cash Back amount (0.86 DKK/kWh spent sharging the vehicle)
- name: "Tesla EV Charging Cash Back DKK"
state_class: "measurement"
unit_of_measurement: "DKK"
icon: mdi:hand-coin
state: "{{ (states('sensor.tesla_wall_connector_monthly_energy_kwh') | float * 0.86 | float) | round(2) }}"
#Outputs the met.no outzide temperature
- name: "Outside Temperature"
state_class: "measurement"
unit_of_measurement: "°C"
icon: mdi:temperature-celsius
state: "{{ state_attr('weather.home', 'temperature') | float }}"
# Outputs the Net Operator tariff #
- name: "Net Operator Tariff"
state_class: "measurement"
unit_of_mesurement: "DKK/kWh"
icon: mdi:cash
state: "{{ state_attr('sensor.net_operator_tariff', 'current_tariff') | float}}"
#########################
### LOW BATTERY LIST ####
#########################
##### Low Battery list ##################################
- name: "Low Battery Devices"
unique_id: ba292875-ae67-480d-9867-29cdb20afaea
icon: >
mdi:battery-low
state: >
{% set threshold = states('input_number.battery_threshold') | int %}
{%- set ns = namespace(sensors=[]) -%}
{%- for state in states.sensor
| selectattr('attributes.device_class', 'defined')
| selectattr('attributes.state_class', 'defined')
| selectattr('attributes.device_class', '==', 'battery')
| selectattr('attributes.state_class', '==', 'measurement')
| selectattr('state', 'is_number') -%}
{%- if state.state | int <= threshold -%}
{% set ns.sensors = ns.sensors + [dict(name = state.name | replace(' battery', '') | replace(' Battery', '') | replace(' level', '') | replace(' Level', ''), state = state.state | int)] %}
{%- endif -%}
{%- endfor -%}
{%- set batt = ns.sensors | sort(attribute='state') %}
{%- set ns = namespace(batt='') -%}
{%- for state in batt -%}
{% set ns.batt= ns.batt + (state.name ~ ' (' ~ state.state ~'%)' ~ "\n") %}
{%- endfor -%}
{% if ns.batt | count > 0 %}
{{ ns.batt | truncate(255, true, '...') }}
{% else %}
{{ 'unavailable' }}
{% endif %}
#################################
### DEAD Z-Wave Device Sensor ###
#################################
- name: "Offline ZWave Devices"
unique_id: offline_zwave_devices
icon: mdi:z-wave
unit_of_measurement: Devices
state: >
{% set devices = state_attr(this.entity_id,'entity_id') %}
{% if devices != none %} {{ devices|count }}
{% else %} {{ devices }}
{% endif %}
attributes:
entity_id: >
{{ expand(integration_entities('Z-Wave JS') )
|selectattr('entity_id', 'search', 'node_status')
|selectattr('state','in','dead, unavailable, unknown')
|map(attribute="object_id")
|map('regex_replace', find='(.*)_node_status', replace='button.\\1_ping', ignorecase=False)|list }}
Please help…