Does anyone know why my node red starts to crash and my tablet hangs in update and not updating the clock, whenever i add the sidebar.yaml??
> [22:13:46] INFO: Starting Node-RED...
> start
> node $NODE_OPTIONS node_modules/node-red/red.js "--settings" "/etc/node-red/config.js"
21 Nov 22:13:50 - [info]
Welcome to Node-RED
===================
21 Nov 22:13:50 - [info] Node-RED version: v3.0.2
21 Nov 22:13:50 - [info] Node.js version: v16.17.1
21 Nov 22:13:50 - [info] Linux 5.15.61-v8 arm64 LE
21 Nov 22:13:51 - [info] Loading palette nodes
Mon, 21 Nov 2022 21:13:55 GMT node-telegram-bot-api deprecated Automatic enabling of cancellation of promises is deprecated.
In the future, you will have to enable it yourself.
See https://github.com/yagop/node-telegram-bot-api/issues/319. at node:internal/modules/cjs/loader:1126:14
21 Nov 22:13:59 - [info] Dashboard version 3.2.0 started at /endpoint/ui
21 Nov 22:14:00 - [warn] ------------------------------------------------------
21 Nov 22:14:00 - [warn] [node-red-contrib-telegrambot-home/bot] 'telegrambot-config' already registered by module @danielnguyen/node-red-contrib-telegrambot-home
21 Nov 22:14:00 - [warn] [node-red-contrib-telegrambot-home/command] 'telegrambot-command' already registered by module @danielnguyen/node-red-contrib-telegrambot-home
21 Nov 22:14:00 - [warn] [node-red-contrib-telegrambot-home/switch] 'telegrambot-switch' already registered by module @danielnguyen/node-red-contrib-telegrambot-home
21 Nov 22:14:00 - [warn] [node-red-contrib-telegrambot-home/notify] 'telegrambot-notify' already registered by module @danielnguyen/node-red-contrib-telegrambot-home
21 Nov 22:14:00 - [warn] [node-red-contrib-telegrambot-home/payload] 'telegrambot-payload' already registered by module @danielnguyen/node-red-contrib-telegrambot-home
21 Nov 22:14:00 - [warn] ------------------------------------------------------
21 Nov 22:14:00 - [info] Settings file : /etc/node-red/config.js
21 Nov 22:14:00 - [info] Context store : 'default' [module=memory]
21 Nov 22:14:00 - [info] User directory : /config/node-red/
21 Nov 22:14:00 - [warn] Projects disabled : editorTheme.projects.enabled=false
21 Nov 22:14:00 - [info] Flows file : /config/node-red/flows.json
21 Nov 22:14:00 - [info] Server now running at http://127.0.0.1:46836/
[22:14:00] INFO: Starting NGinx...
21 Nov 22:14:01 - [info] Starting flows
21 Nov 22:14:02 - [info] Started flows
21 Nov 22:14:02 - [info] [mqtt-broker:701d4c9a.51c814] Connected to broker: mqtt://192.168.1.47:1883
21 Nov 22:14:04 - [error] [api-current-state:someone i home?] InputError: group.anyone_home
21 Nov 22:14:06 - [info] [server:Home Assistant] Connecting to http://supervisor/core
21 Nov 22:14:06 - [info] [server:Home Assistant] Connected to http://supervisor/core
Received state update for unknown entity sensor.template_sidebar
Received event for unknown subscription 20. Unsubscribing.
Received state update for unknown entity sensor.template_sidebar
Received state update for unknown entity sensor.template_sidebar
Received state update for unknown entity sensor.template_sidebar
Received state update for unknown entity sensor.template_sidebar
Received state update for unknown entity sensor.template_sidebar
Received state update for unknown entity sensor.template_sidebar
Received state update for unknown entity sensor.template_sidebar
Received state update for unknown entity sensor.template_sidebar
Received state update for unknown entity sensor.template_sidebar
Received state update for unknown entity sensor.template_sidebar
Received state update for unknown entity sensor.template_sidebar
Received state update for unknown entity sensor.template_sidebar
Received state update for unknown entity sensor.template_sidebar
Received state update for unknown entity sensor.template_sidebar
Received state update for unknown entity sensor.template_sidebar
Received state update for unknown entity sensor.template_sidebar
Received state update for unknown entity sensor.template_sidebar
Received state update for unknown entity sensor.template_sidebar
Received state update for unknown entity sensor.template_sidebar
Received state update for unknown entity sensor.template_sidebar
Received state update for unknown entity sensor.template_sidebar
Received state update for unknown entity sensor.template_sidebar
Received state update for unknown entity sensor.template_sidebar
Received state update for unknown entity sensor.template_sidebar
Received state update for unknown entity sensor.template_sidebar
Received state update for unknown entity sensor.template_sidebar
Received state update for unknown entity sensor.template_sidebar
Received state update for unknown entity sensor.template_sidebar
SIDEBAR code
- sensor:
- unique_id: sidebar
state: template
attributes:
time: >
{% set hours = now().strftime('%H') %}
{% set minutes = now().strftime('%M') %}
<span class="time">
{{ hours }}<span class="time-colon">:</span>{{ minutes }}
</span>
date: |
<font color='#6a7377'><b>
{%- if strptime(states('sensor.date'), '%Y-%m-%d').day != null %}
{%- set days = ['Mandag', 'Tirsdag', 'Onsdag', 'Torsdag', 'Fredag', 'Lørdag', 'Søndag'] %}
{%- set months = ['Januar', 'Februar', 'Marts', 'April', 'Maj', 'Juni',
'Juli', 'August', 'September', 'Oktober', 'November', 'December'] %}
{{- days[now().weekday()] }}<br>
{{- strptime(states('sensor.date'), '%Y-%m-%d').day }} {{ months[now().month-1] }}
{%- endif -%}
</b></font>
heatoff: |
{% if is_state('input_boolean.clima_off_outside_temp', 'off') -%}
Klima: varme slukket
{%- else %}
Klima: varme er tændt
{%- endif %}
Clima: |
{%- set clima = states('sensor.median_humidity_rooms') %}
{% if not is_state('sensor.median_humidity_rooms', 'unknown') %}
{%- if clima | float(default=0) <= 60 -%}
Klima OK {{clima}}%
{%- elif clima | float(default=0) > 60 -%}
<font color='#e01b1e'>Fugtigheden er for høj {{clima}}% </font>
{%- endif %}
{%- else %}
kan ikke måle fugtigheden
{%- endif %}
elpris: |
{%- set elpris = states('sensor.nordpool_kwh_dk2_dkk_3_099_025') %}
{% if elpris | float(default=0) >= 0.0 -%}
{{-'\u26a1'}} {{elpris}} kr. pr kWh
{%- else %}
Kan ikke indlæse elpris
{%- endif %}
weatherforecast: |
{%- set temperature = states('sensor.weather_hjem_temperature_forecast_today') %}
{%- set apparent = states('sensor.hjem_realfeel_temperature_max_0d') | round %}
{%- set precip = states('sensor.weather_precipitation_probability') | round %}
{%- set windforecast = states('sensor.weather_hjem_wind_forecast_today') | round %}
{% if not is_state('sensor.pirateweather_temperature', 'unknown') %}
{% if is_state('binary_sensor.morning_weather', 'on') -%}
Vejret i dag: Temp. {{temperature}}°, Feel max {{ apparent}}°, vind {{windforecast}} m/s., risko for nedbør {{ precip }}%
{%- endif %}
{%- else %}
Kan ikke indlæse vejret....
{%- endif %}
weather: |
{%- set temperature = states('sensor.weather_outside_temperature') %}
{%- set apparent = states('sensor.hjem_realfeel_temperature') | round %}
{%- set precip = states('sensor.weather_precipitation_probability') | round %}
{%- set wind = states('sensor.weather_hjem_windspeed_current') | round %}
{% if not is_state('sensor.weather_outside_temperature', 'unknown') %}
{%- if temperature | float(default=0) <= 0.0 -%}
Temp er {{temperature}}° men føles som {{ apparent}}°, med en vind på {{wind}} m/s. og {{ precip }}% risiko for sne {{'\u2744\uFE0F'}}
{%- elif temperature | float(default=0) > 0.0 -%}
Temp er {{temperature}}° men føles som {{ apparent}}°, med en vind på {{wind}} m/s. og {{ precip }}% risiko for regn {{ '\u2614\uFE0F' if precip > 30 }}
{%- endif %}
{%- else %}
Kan ikke indlæse vejret....
{%- endif %}
active: |
<b>
{%- set lights = [
states.light.office,
states.light.livingroom,
states.light.bedroom,
states.light.kitchen,
states.light.dining_room,
states.light.bathroom,
states.light.entre
] %}
{%- set switches = [
states.media_player.phillips_tv,
states.light.fan_bathroom,
states.switch.plug1,
states.switch.pc_laptop
] %}
{%- set media_players = [
states.media_player.phillips_tv,
states.media_player.mini,
states.media_player.googlehome7393,
states.media_player.chromecast8347,
states.media_player.nestaudio0625,
states.media_player.under_seng
] %}
{%- set lights_on = lights | selectattr('state','eq','on') | list %}
{%- set lights_name = lights | selectattr('state','eq','on') | map(attribute='name') | join(', ') %}
{%- set switches_on = switches | selectattr('state','eq','on') | list %}
{%- set media_players_playing = media_players | selectattr('state','eq','playing') | list %}
{%- set append = switches_on + media_players_playing %}
{%- set switches_name = append | map(attribute='name') | join(', ') %}
{%- if (lights_on | length == 0) and (switches_on | length > 0) -%}
{{ switches_name | regex_replace(',([^,]*)$',' og\\1') }} er tændt
{%- elif (lights_on | length == 1) and (switches_on | length == 1) -%}
{{ lights_name }} og {{switches_name }} er tændt
{%- elif (lights_on | length == 1) and (switches_on | length == 1)-%}
{{ lights_name }} og {{switches_name }} er tændt
{%- elif (lights_on | length == 1) and (switches_on | length > 1) -%}
{{ lights_name }}, {{ switches_name | regex_replace(',([^,]*)$',' og\\1') }} er tændt
{%- elif (lights_on | length > 1) and (switches_on | length == 1) -%}
{{ lights_on | length }} lamper og {{ switches_name }} er tændt
{%- elif (lights_on | length > 1) and (switches_on | length > 1) -%}
{{ lights_on | length }} lamper, {{ switches_name | regex_replace(',([^,]*)$',' og\\1') }} er tændt
{%- elif (lights_on | length == 1) and (switches_on | length == 0) -%}
{{ lights_name }} er tændt
{%- elif (lights_on | length > 1) and (switches_on | length == 0) -%}
{{ lights_on | length }} lys er tændt
{%- else %}
<font color='#6a7377'>Alt er slukket</font>
{%- endif -%}
</b>
Windows: |
<b>
{%- set windows = [
states.binary_sensor.window_bathroom_contact,
states.binary_sensor.window_bedroom_contact
] %}
{%- set windows_state = windows | selectattr('state','eq','on') | list %}
{%- set windows_name = windows | selectattr('state','eq','on') | map(attribute='name') | join(', ') %}
{%- if (windows_state | length == 1 ) -%}
{{-'\uD83E\uDE9F'}} {{ windows_name }} er åbent
{%- elif (windows_state | length == 2 ) -%}
{{-'\uD83E\uDE9F'}} {{ windows_name | regex_replace(',([^,]*)$',' og\\1') }} er åbne
{%- endif -%}
</b>
vacuum: |
{% set entity_id = 'vacuum.xiaomi_vacuum_cleaner' %}
{%- if is_state(entity_id, 'cleaning') -%}
<b>SugeLone støvsuger</b>
{%- elif is_state(entity_id, 'returning') -%}
<b>Sutte Lone er færdig</b>
{%- endif %}
battery: |
{% set entities = [
'sensor.phillips_hue_switch_battery',
'sensor.shade_bedroom_battery',
'sensor.pir2_battery',
'sensor.pir_bathroom_battery',
'sensor.pir_kitchen_battery',
'sensor.pir_office_battery',
'sensor.switch_cover_bedroom_battery',
'sensor.switch_kitchen_battery',
'sensor.tablet_battery_level',
'sensor.thermometer_bathroom_battery',
'sensor.thermometer_livingroom_battery',
'sensor.thermometer_kitchen_battery',
'sensor.thermometer_bedroom_battery',
'sensor.thermometer_office_battery',
'sensor.thermostat_livingroom_2_battery',
'sensor.thermostat_livingroom_battery',
'sensor.thermostat_bedroom_battery',
'sensor.thermostat_kitchen_battery',
'sensor.thermostat_office_battery',
'sensor.thermostat_bathroom_battery',
'sensor.bath_window_battery',
'sensor.bedroom_window_battery',
'sensor.switch_bedroom_battery',
'sensor.waterleak_hydroponic_battery' ] %}
{%- for sensor in entities if states(sensor) != 'unknown' and states(sensor) != 'unavailable' and states(sensor) != 'None' and states(sensor) | int(default=0) <= 7 %}
{%- if loop.first %} {{-'\u26A0\uFE0F'}} Battery {% else %}, {% endif -%}
{{ state_attr(sensor, 'friendly_name') }} {{ states(sensor) }}%
{%- endfor %}
calendar: |
{%- set message = state_attr('calendar.family', 'message') %}
{%- set start_time = state_attr('calendar.family', 'start_time') %}
{%- set end_time = state_attr('calendar.family', 'end_time') %}
{% if start_time != None %}
{%- set time = as_timestamp(start_time) | timestamp_custom('%H:%M') %}
{%- set time_end = as_timestamp(end_time) | timestamp_custom('%H:%M') %}
{%- set hours = as_timestamp(start_time) | timestamp_custom('%H') | int(default=0) / 24 %}
{%- set count = (as_timestamp(start_time) - as_timestamp(now())) / 86400 - hours %}
{%- set day = strptime(start_time, '%Y-%m-%d %H:%M:%S').strftime('%A')
| replace('Monday', 'Mandag')
| replace('Tuesday', 'Tirsdag')
| replace('Wednesday', 'Onsdag')
| replace('Thursday', 'Torsdag')
| replace('Friday', 'Fredag')
| replace('Saturday', 'Lørdag')
| replace('Sunday', 'Søndag') %}
{%- if count <= 0.0 -%}
{{ message }} {{ time }}-{{ time_end }}
{%- elif count <= 1.0 -%}
{{message}} i morgen mellem {{ time }}-{{ time_end }}
{%- elif count <= 2.0 -%}
{{message}} i overmorgen mellem {{ time }}-{{ time_end }}
{%- else -%}
{{message}} om {{ (count + hours) | round }} dage på {{ day }} mellem {{ time }}-{{ time_end }}
{%- endif %}
{%- endif %}
calendarnemlig: |
{%- set start_time = state_attr('calendar.nemlig', 'start_time') %}
{%- set end_time = state_attr('calendar.nemlig', 'end_time') %}
{% if start_time != None %}
{%- set time = as_timestamp(start_time) | timestamp_custom('%H:%M') %}
{%- set time_end = as_timestamp(end_time) | timestamp_custom('%H:%M') %}
{%- set hours = as_timestamp(start_time) | timestamp_custom('%H') | int(default=0) / 24 %}
{%- set count = (as_timestamp(start_time) - as_timestamp(now())) / 86400 - hours %}
{%- set day = strptime(start_time, '%Y-%m-%d %H:%M:%S').strftime('%A')
| replace('Monday', 'Mandag')
| replace('Tuesday', 'Tirsdag')
| replace('Wednesday', 'Onsdag')
| replace('Thursday', 'Torsdag')
| replace('Friday', 'Fredag')
| replace('Saturday', 'Lørdag')
| replace('Sunday', 'Søndag') %}
{%- if count <= 0.0 -%}
{{'\U0001F6D2'}} Nemlig idag mellem {{ time }}-{{ time_end }}
{%- elif count <= 1.0 -%}
Nemlig imorgen mellem {{ time }}-{{ time_end }}
{%- elif count <= 2.0 -%}
Nemlig i overmorgen mellem {{ time }}-{{ time_end }}
{%- else -%}
Nemlig om {{ (count + hours) | round }} dage på {{ day }} mellem {{ time }}-{{ time_end }}
{%- endif %}
{%- endif %}