Skip to content

Instantly share code, notes, and snippets.

platform: template
sensors:
nextsunrise:
entity_id: sun.sun
friendly_name: 'Next Sunrise'
value_template: >
{{ as_timestamp(states.sun.sun.attributes.next_rising) | timestamp_custom(' %I:%M %p') | replace(" 0", "") }}
icon_template: mdi:weather-sunset-up
nextsunset:
entity_id: sun.sun
platform: template
sensors:
nextsunrise:
friendly_name: 'Next Sunrise'
value_template: >
{{ as_timestamp(state_attr('sun.sun, 'next_rising') | timestamp_custom(' %I:%M %p') | replace(" 0", "") }}
icon_template: mdi:weather-sunset-up
nextsunset:
entity_id: sun.sun
friendly_name: 'Next Sunset'
Invalid config for [sensor.template]: invalid template (TemplateSyntaxError: expected token ',', got 'next_rising') for dictionary value @ data['sensors']['nextsunrise']['value_template']. Got '{{ as_timestamp(state_attr(\'sun.sun, \'next_rising\') | timestamp_custom(\' %I:%M %p\') | replace(" 0", "") }}\n'
invalid template (TemplateSyntaxError: expected token ',', got 'next_rising') for dictionary value @ data['sensors']['nextsunset']['value_template']. Got '{{ as_timestamp(state_attr(\'sun.sun, \'next_rising\') | timestamp_custom(\' %I:%M %p\') | replace(" 0", "") }}\n'. (See ?, line ?).
@thorrrr
thorrrr / template.yaml
Created March 8, 2021 22:05
Created with Copy to Gist
alias: Galley Lights
description: ''
mode: single
trigger:
- platform: state
entity_id: binary_sensor.lumi_lumi_sensor_motion_aq2_731c7906_ias_zone
to: 'on'
condition:
- condition: numeric_state
entity_id: sensor.lumi_lumi_sensor_motion_aq2_731c7906_illuminance
@thorrrr
thorrrr / template.yaml
Created March 8, 2021 22:39
Created with Copy to Gist
alias: Galley Lights
description: ''
mode: single
trigger:
- platform: state
entity_id: binary_sensor.lumi_lumi_sensor_motion_aq2_731c7906_ias_zone
to: 'on'
condition:
- condition: numeric_state
entity_id: sensor.lumi_lumi_sensor_motion_aq2_731c7906_illuminance
@thorrrr
thorrrr / template.yaml
Created March 10, 2021 15:30
Created with Copy to Gist
The following files / folders may not be accessible to the users allowed via each Share's SMB settings.  This is often caused by wrong permissions being used on new downloads / copies by CouchPotato, Sonarr, and the like:
/mnt/user/data/media/mma/bkfc/Uploaded by FightFan on SpotNet.txt  nobody/users (99/100)  0700
/mnt/user/data/media/movies/Arrival (2016)/Arrival (2016) [Bluray-1080p x264 DTS].en.forced.srt  nobody/users (99/100)  0640
/mnt/user/data/media/movies/Come to Daddy (2020)/Come to Daddy (2019) [Remux-1080p AVC DTS-HD MA].en.srt  nobody/users (99/100)  0640
/mnt/user/data/media/movies/Debt Collectors (2020)/Debt Collectors (2020) [Bluray-1080p] [8bit] [x264] [DTS-HD MA-5.1]-HDH.mkv  nobody/users (99/100)  0700
/mnt/user/data/media/movies/Debt Collectors (2020)/Debt Collectors (2020) [Bluray-1080p] [8bit] [x264] [DTS-HD MA-5.1]-HDH.srt  nobody/users (99/100)  0700
/mnt/user/data/media/movies/Hard Kill (2020)/Hard Kill (2020) [Bluray-1080p] [8bit] [x264] [DTS-5.1]-iFT.mkv  nobody/users (99/100)  07
@thorrrr
thorrrr / template.yaml
Created March 10, 2021 18:28
Created with Copy to Gist
The following user shares will be excluded from the permissions tests:
/mnt/user/appdata
Processing /mnt/user/backup
Processing /mnt/user/data
Processing /mnt/user/domains
Processing /mnt/user/isos
Processing /mnt/user/nextcloud
Processing /mnt/user/system
@thorrrr
thorrrr / template.yaml
Last active March 11, 2021 21:44
Created with Copy to Gist
alexaapi.get_state((<alexapy.alexaapi.AlexaAPI object at 0x7f51b5a911c0>,), {}): An error occured accessing AlexaAPI: An exception of type AlexapyLoginError occurred. Arguments: ('Login error detected; not contacting API',)
21:39:59 – /usr/local/lib/python3.8/site-packages/alexapy/helpers.py (WARNING) - message first occurred at 18:56:10 and shows up 76 times
alexaapi.get_last_device_serial((<alexapy.alexalogin.AlexaLogin object at 0x7f51afb65fd0>,), {}): A login error occured: An exception of type JSONDecodeError occurred. Arguments: ('Expecting value: line 1 column 1 (char 0)',)
21:39:49 – /usr/local/lib/python3.8/site-packages/alexapy/helpers.py (WARNING) - message first occurred at 18:56:10 and shows up 15 times
Error doing job: Unclosed connection
21:39:23 – runner.py (ERROR) - message first occurred at 21:12:48 and shows up 2 times
https://homeassistant.xxxxxxxxxxxxx.co.uk/frontend_latest/chunk.ab01d5a9d4bd1e838d41.js:179:939 Uncaught TypeError: Cannot read property 'attributes' of undefined
20:34:33 –
@thorrrr
thorrrr / template.yaml
Created April 9, 2021 14:41
Created with Copy to Gist
Stairs Lights Turn on with Motion
alias: 'Stairs Lights Turn on with Motion '
description: ''
trigger:
- platform: state
entity_id: binary_sensor.motion_sensor_stairs
to: 'on'
condition:
- condition: numeric_state
entity_id: sensor.stairs_lux_lumination
@thorrrr
thorrrr / template.yaml
Created April 15, 2021 13:50
Created with Copy to Gist
condition: numeric_state
value_template: >-
{{states.sensor.landing_lux_lumination.state|float <
states.input_number.min_light_level.state | float}}