diff --git a/Todo.md b/Todo.md new file mode 100755 index 00000000..5254309b --- /dev/null +++ b/Todo.md @@ -0,0 +1,35 @@ +#Todo List + +# Break out configuration files. HASS user. + +# AUTOMATE LAMP UPSTAIRS USING ifttt AND Nest thermostat. +# Put Dash Buttons out there. +# Put door sensor on garage door + + + ### Future Ideas + +# - alias: 'Get Random Time' + # trigger: + # platform: time + # after: '21:00:00' + # action: + # - service: input_slider.select_value + # data_template: + # entity_id: input_slider.hour + # value: '{{ (range(22, 23) | random) }}' + # - service: input_slider.select_value + # data_template: + # entity_id: input_slider.random_minute + # value: '{{ (range(30, 45) | random) }}' +# Then simply use that in your light turn off automation: + +# - alias: 'Turn lights off' + # trigger: + # platform: template + # value_template: '{{ now.hour == (states.input_slider.random_hour.state | int) and now.minute == (states.input_slider.random_minute.state | int) }}' + # action: + # - service: light.turn_off + # data: + # entity_id: light.hue_color_lamp_1 + \ No newline at end of file diff --git a/automation/bad_logins.yaml b/automation/bad_logins.yaml new file mode 100755 index 00000000..710c5f69 --- /dev/null +++ b/automation/bad_logins.yaml @@ -0,0 +1,8 @@ +- alias: Login Failure + trigger: + platform: numeric_state + entity_id: sensor.badlogin + above: 1 + action: + service: ifttt.trigger + data: {"event":"device_status", "value1":"Home Assistant Error: ", "value2":"Login Failure Detected"} diff --git a/automation/device_status.yaml b/automation/device_status.yaml new file mode 100755 index 00000000..e53b98d3 --- /dev/null +++ b/automation/device_status.yaml @@ -0,0 +1,15 @@ +- alias: 'Device Status' +#This recipe sends a POST to IFTTT Maker channel. IFTTT then sends me a SMS Text with "device_status : Wii is Offline." + trigger: + - platform: state + entity_id: + - sensor.wii + - sensor.tablotv + - sensor.hue_hub + - sensor.alexa_echo + - sensor.rachio + - sensor.circle + - sensor.skybell + action: + service: ifttt.trigger + data_template: {"event":"device_status", "value1":"{{ trigger.entity_id.split('.')[1] }}", "value2":"{{ trigger.to_state.state }}"} diff --git a/automation/good_night.yaml b/automation/good_night.yaml new file mode 100755 index 00000000..9e04825e --- /dev/null +++ b/automation/good_night.yaml @@ -0,0 +1,17 @@ +- alias: 'GoodNight - Away Mode' +# There is also an IFTTT recipe that shuts down all lights when Nest goes into Away mode. - event_type= Good_Night + trigger: + - platform: state + entity_id: group.family + state: 'not_home' + - platform: event + event_type: good_night + + condition: + condition: state + entity_id: group.family + state: not_home + + action: + service: light.turn_off + entity_id: group.all_lights diff --git a/automation/heal_zwave.yaml b/automation/heal_zwave.yaml new file mode 100755 index 00000000..b02b9155 --- /dev/null +++ b/automation/heal_zwave.yaml @@ -0,0 +1,6 @@ +- alias: Heal ZWave Nightly + trigger: + platform: time + after: '2:31:00' + action: + service: zwave.heal_network diff --git a/automation/startup_notification.yaml b/automation/startup_notification.yaml new file mode 100755 index 00000000..64dca02c --- /dev/null +++ b/automation/startup_notification.yaml @@ -0,0 +1,7 @@ +- alias: Startup Notification + trigger: + platform: event + event_type: homeassistant_start + action: + service: ifttt.trigger + data: {"event":"device_status", "value1":"Home Assistant", "value2":"Up and Running"} diff --git a/automation/tv_time.yaml b/automation/tv_time.yaml new file mode 100755 index 00000000..33c7bd8b --- /dev/null +++ b/automation/tv_time.yaml @@ -0,0 +1,16 @@ +- alias: TV Time + trigger: + - platform: sun + event: sunset + offset: '+00:30:00' + - platform: event + event_type: tv_time + + condition: + condition: state + entity_id: group.family + state: home + + action: + service: scene.turn_on + entity_id: scene.living_room_tv_time diff --git a/automation/update_notification.yaml b/automation/update_notification.yaml new file mode 100755 index 00000000..a3b9fbcc --- /dev/null +++ b/automation/update_notification.yaml @@ -0,0 +1,8 @@ +- alias: "Update Available Notification" + trigger: + platform: state + entity_id: updater.updater + action: + service: ifttt.trigger + data: {"event":"device_status", "value1":"Home Assistant Update: ", "value2":"Available"} + \ No newline at end of file diff --git a/automation/zwave_door_sensor.yaml b/automation/zwave_door_sensor.yaml new file mode 100755 index 00000000..7455e9a9 --- /dev/null +++ b/automation/zwave_door_sensor.yaml @@ -0,0 +1,21 @@ +- alias: ZWave Enerwave Door Sensors Open + trigger: + platform: event + event_type: zwave.node_event + event_data: + object_id: enerwave_unknown_type0601_id0903_2 + basic_level: 255 + action: + service: light.turn_off + entity_id: light.office_lamp + +- alias: ZWave Enerwave Door Sensors Closed + trigger: + platform: event + event_type: zwave.node_event + event_data: + object_id: enerwave_unknown_type0601_id0903_2 + basic_level: 0 + action: + service: light.turn_on + entity_id: light.office_lamp diff --git a/configuration.yaml b/configuration.yaml index bda7d50f..71b47451 100755 --- a/configuration.yaml +++ b/configuration.yaml @@ -5,93 +5,27 @@ homeassistant: elevation: !secret homeassistant_elevation unit_system: imperial time_zone: America/New_York + customize: !include_dir_merge_named customize - customize: - climate.downstairs: - friendly_name: 'Nest Downstairs' - icon: mdi:air-conditioner - climate.upstairs: - friendly_name: 'Nest Upstairs' - icon: mdi:air-conditioner - sensor.dark_sky_precip_intensity: - friendly_name: 'Rainfall' - sensor.dark_sky_humidity: - friendly_name: 'Outdoor Humidity' - sensor.dark_sky_temperature: - friendly_name: 'Outdoor Temp' - sensor.speedtest_download: - friendly_name: 'Download' - icon: mdi:speedometer - sensor.speedtest_upload: - friendly_name: 'Upload' - icon: mdi:speedometer - media_player.roku_1gj361038190: - friendly_name: 'Downstairs Main Roku' - media_player.roku_1gs3ac111661: - friendly_name: 'Upstairs Roku' - media_player.roku_2N006T621680: - friendly_name: 'Bedroom Roku' - sensor.wii: - icon: mdi:gamepad-variant - sensor.tablotv: - icon: mdi:television-guide - sensor.hue_hub: - icon: mdi:router-wireless - sensor.rachio: - icon: mdi:spray - sensor.circle: - icon: mdi:google-circles-group - sensor.alexa_echo: - icon: mdi:amazon - sensor.skybell: - icon: mdi:camera-front - sensor.samsungtv: - icon: mdi:television - sensor.since_last_boot_templated: - friendly_name: 'HomeAssistant Uptime' - icon: mdi:clock-start - sensor.since_last_boot: - hidden: true - sensor.badlogin: - hidden: true - device_tracker.tablotv: - hidden: true - device_tracker.hue_hub: - hidden: true - device_tracker.wii: - hidden: true - device_tracker.rachio: - hidden: true - device_tracker.circle: - hidden: true - device_tracker.alexa_echo: - hidden: true - device_tracker.skybell: - hidden: true - device_tracker.samsungtv: - hidden: true - http: api_password: !secret http_api_password - + +frontend: +group: !include_dir_merge_named group +device_tracker: !include_dir_merge_list device_tracker discovery: +sun: light: platform: hue - host: 192.168.10.101 + host: 192.168.10.106 allow_unreachable: true ifttt: key: !secret ifttt_key -device_tracker: - platform: nmap_tracker - hosts: 192.168.10.100-254 - track_new_devices: no - # consider_home: 1800 - Added to known_devices.yaml instead on a device by device basis. - -frontend: # history: + logbook: exclude: entities: @@ -99,8 +33,8 @@ logbook: - sensor.since_last_boot_templated #logger: # default: info - -sun: +recorder: + purge_days: 14 mqtt: broker: 127.0.0.1 @@ -112,24 +46,6 @@ mqtt: zwave: usb_path: /dev/ttyACM0 config_path: /srv/hass/hass_venv/lib/python3.4/site-packages/libopenzwave-0.3.1-py3.4-linux-armv7l.egg/config - -sensor forecast: - platform: darksky - api_key: !secret forecast_key - - monitored_conditions: - - summary -# - precip_type - - precip_intensity - - temperature -# - dew_point -# - wind_speed -# - wind_bearing -# - cloud_cover - - humidity -# - pressure -# - visibility -# - ozone nest: username: !secret nest_username @@ -140,364 +56,8 @@ climate: media_player: platform: cast - -recorder: - purge_days: 14 - -sensor Speedtest: - platform: speedtest - minute: 30 - hour: - - 0 - - 6 - - 12 - - 18 - monitored_conditions: - - download - - upload - -# emulated_hue: - # host_ip: 192.168.10.10 - # listen_port: 8300 -# off_maps_to_on_domains: -# - script -# - scene - -# A comma separated list of states that have to be tracked as a single group -# Grouped states should share the same type of states (ON/OFF or HOME/NOT_HOME) -group: !include_dir_merge_named group - - -switch: - platform: rpi_rf - gpio: 17 - switches: - Outlet_Living_Room: - protocol: 1 - pulselength: 186 - code_on: 5265155 - code_off: 5265164 - Outlet_2: - protocol: 1 - pulselength: 186 - code_on: 5264835 - code_off: 5264844 - Outlet_Garage: - protocol: 1 - pulselength: 186 - code_on: 5264691 - code_off: 5264700 - -sensor Devices: - platform: template - sensors: - wii: - friendly_name: 'Wii' - value_template: >- - {%- if is_state("device_tracker.wii", "home") %} - Online - {% else %} - Offline - {%- endif %} - tablotv: - friendly_name: 'Tablo TV' - value_template: >- - {%- if is_state("device_tracker.tablotv", "home") %} - Online - {% else %} - Offline - {%- endif %} - hue_hub: - friendly_name: 'Hue Hub' - value_template: >- - {%- if is_state("device_tracker.hue_hub", "home") %} - Online - {% else %} - Offline - {%- endif %} - alexa_echo: - friendly_name: 'Alexa Echo' - value_template: >- - {%- if is_state("device_tracker.alexa_echo", "home") %} - Online - {% else %} - Offline - {%- endif %} - circle: - friendly_name: 'Disney Circle' - value_template: >- - {%- if is_state("device_tracker.circle", "home") %} - Online - {% else %} - Offline - {%- endif %} - rachio: - friendly_name: 'Rachio Sprinklers' - value_template: >- - {%- if is_state("device_tracker.rachio", "home") %} - Online - {% else %} - Offline - {%- endif %} - skybell: - friendly_name: 'Skybell Doorbell' - value_template: >- - {%- if is_state("device_tracker.skybell", "home") %} - Online - {% else %} - Offline - {%- endif %} - samsungtv: - friendly_name: 'Samsung TV' - value_template: >- - {%- if is_state("device_tracker.samsungtv", "home") %} - Online - {% else %} - Offline - {%- endif %} - - -sensor Login_Failures: - platform: command_line - command: "grep -c invalidpassword /home/hass/.homeassistant/home-assistant.log" - name: badlogin - -sensor: -- platform: systemmonitor - resources: - # - type: last_boot - - type: since_last_boot - -- platform: template - sensors: - since_last_boot_templated: - value_template: >- - {%- set slb = states.sensor.since_last_boot.state.split(' ') -%} - {%- set count = slb | length -%} - {%- set hms = slb[count - 1] -%} - {%- set hms_trimmed = hms.split('.')[0] -%} - {%- set hms_split = hms_trimmed.split(':') -%} - {%- set hours = hms_split[0] | int -%} - {%- set minutes = hms_split[1] | int -%} - {%- set seconds = hms_split[2] | int -%} - - {%- if count == 3 -%} - {{ slb[0] ~ ' ' ~ slb[1] ~ ' ' }} - {%- endif -%} - {%- if hours > 0 -%} - {%- if hours == 1 -%} - 1 hour - {%- else -%} - {{ hours }} hours - {%- endif -%} - {%- endif -%} - {%- if minutes > 0 -%} - {%- if hours > 0 -%} - {{ ', ' }} - {%- endif -%} - {%- if minutes == 1 -%} - 1 minute - {%- else -%} - {{ minutes }} minutes - {%- endif -%} - {%- endif -%} - {%- if seconds > 0 -%} - {%- if hours > 0 or minutes > 0 -%} - {{ ', ' }} - {%- endif -%} - {%- if seconds == 1 -%} - 1 second - {%- else -%} - {{ seconds }} seconds - {%- endif -%} - {%- endif -%} - -automation: -- alias: Heal ZWave Nightly - trigger: - platform: time - after: '2:31:00' - action: - service: zwave.heal_network - -- alias: "Update Available Notification" - trigger: - platform: state - entity_id: updater.updater - action: - service: ifttt.trigger - data: {"event":"device_status", "value1":"Home Assistant Update: ", "value2":"Available"} - -- alias: Login Failure - trigger: - platform: numeric_state - entity_id: sensor.badlogin - above: 1 - action: - service: ifttt.trigger - data: {"event":"device_status", "value1":"Home Assistant Error: ", "value2":"Login Failure Detected"} - -- alias: 'Device Status' -#This recipe sends a POST to IFTTT Maker channel. IFTTT then sends me a SMS Text with "device_status : Wii is Offline." - trigger: - - platform: state - entity_id: - - sensor.wii - - sensor.tablotv - - sensor.hue_hub - - sensor.alexa_echo - - sensor.rachio - - sensor.circle - - sensor.skybell - action: - service: ifttt.trigger - data_template: {"event":"device_status", "value1":"{{ trigger.entity_id.split('.')[1] }}", "value2":"{{ trigger.to_state.state }}"} - -- alias: Startup Notification - trigger: - platform: event - event_type: homeassistant_start - action: - service: ifttt.trigger - data: {"event":"device_status", "value1":"Home Assistant", "value2":"Up and Running"} - -- alias: 'GoodNight - Away Mode' -# There is also an IFTTT recipe that shuts down all lights when Nest goes into Away mode. - event_type= Good_Night - trigger: - - platform: state - entity_id: group.family - state: 'not_home' - - platform: event - event_type: good_night - - condition: - condition: state - entity_id: group.family - state: not_home - - action: - service: light.turn_off - entity_id: group.all_lights - -- alias: ZWave Enerwave Door Sensors Open - trigger: - platform: event - event_type: zwave.node_event - event_data: - object_id: enerwave_unknown_type0601_id0903_2 - basic_level: 255 - action: - service: light.turn_off - entity_id: light.office_lamp - -- alias: ZWave Enerwave Door Sensors Closed - trigger: - platform: event - event_type: zwave.node_event - event_data: - object_id: enerwave_unknown_type0601_id0903_2 - basic_level: 0 - action: - service: light.turn_on - entity_id: light.office_lamp - -- alias: TV Time - trigger: - - platform: sun - event: sunset - offset: '+00:30:00' - - platform: event - event_type: tv_time - - condition: - condition: state - entity_id: group.family - state: home - - action: - service: scene.turn_on - entity_id: scene.living_room_tv_time - -scene: - - name: Living Room TV Time - entities: - light.dinette_light_1: - state: off - transition: 10 - light.dinette_light_2: - state: off - transition: 10 - light.living_room_front_left: - state: off - transition: 10 - light.living_room_front_right: - state: off - transition: 10 - light.living_room_slider: - state: off - transition: 10 - light.living_room_back_right: - state: on - transition: 10 - brightness: 1 - light.living_room_back_left: - state: on - transition: 40 - brightness: 1 - light.living_room_couch_1: - state: on - transition: 400 - xy_color: [0.6621,0.3023] - brightness: 255 - light.living_room_couch_2: - state: on - transition: 400 - xy_color: [0.6621,0.3023] - brightness: 255 - light.couch_tv_light: - state: on - transition: 400 - xy_color: [0.6621,0.3023] - brightness: 100 - - -# Restart Homebridge on HASS start -# shell_command: - # restart_homebridge: 'sudo su pi -c "pm2 restart homebridge"' - # start_homebridge: 'sudo su pi -c "pm2 start homebridge"' - # stop_homebridge: 'sudo su pi -c "pm2 stop homebridge"' - - ### Future Ideas - -# - alias: 'Get Random Time' - # trigger: - # platform: time - # after: '21:00:00' - # action: - # - service: input_slider.select_value - # data_template: - # entity_id: input_slider.hour - # value: '{{ (range(22, 23) | random) }}' - # - service: input_slider.select_value - # data_template: - # entity_id: input_slider.random_minute - # value: '{{ (range(30, 45) | random) }}' -# Then simply use that in your light turn off automation: - -# - alias: 'Turn lights off' - # trigger: - # platform: template - # value_template: '{{ now.hour == (states.input_slider.random_hour.state | int) and now.minute == (states.input_slider.random_minute.state | int) }}' - # action: - # - service: light.turn_off - # data: - # entity_id: light.hue_color_lamp_1 - - -#Todo List - -# Break out configuration files. HASS user. - -# AUTOMATE LAMP UPSTAIRS USING ifttt AND Nest thermostat. -# Put Dash Buttons out there. -# Put door sensor on garage door \ No newline at end of file + +sensor: !include_dir_merge_list sensor +automation: !include_dir_merge_list automation +scene: !include_dir_merge_list scene +switch: !include_dir_merge_list switch diff --git a/customize/darksky.yaml b/customize/darksky.yaml new file mode 100755 index 00000000..00b5595f --- /dev/null +++ b/customize/darksky.yaml @@ -0,0 +1,7 @@ +sensor.dark_sky_precip_intensity: + friendly_name: 'Rainfall' +sensor.dark_sky_humidity: + friendly_name: 'Outdoor Humidity' +sensor.dark_sky_temperature: + friendly_name: 'Outdoor Temp' + \ No newline at end of file diff --git a/customize/homeassistant.yaml b/customize/homeassistant.yaml new file mode 100755 index 00000000..507f00a8 --- /dev/null +++ b/customize/homeassistant.yaml @@ -0,0 +1,9 @@ +sensor.since_last_boot_templated: + friendly_name: 'HomeAssistant Uptime' + icon: mdi:clock-start + +sensor.since_last_boot: + hidden: true + +sensor.badlogin: + hidden: true \ No newline at end of file diff --git a/customize/internet.yaml b/customize/internet.yaml new file mode 100755 index 00000000..23cabc20 --- /dev/null +++ b/customize/internet.yaml @@ -0,0 +1,13 @@ +sensor.speedtest_download: + friendly_name: 'Download' + icon: mdi:speedometer + +sensor.speedtest_upload: + friendly_name: 'Upload' + icon: mdi:speedometer + +sensor.circle: + icon: mdi:google-circles-group +device_tracker.circle: + hidden: true + diff --git a/customize/nest.yaml b/customize/nest.yaml new file mode 100755 index 00000000..54a8c8b9 --- /dev/null +++ b/customize/nest.yaml @@ -0,0 +1,7 @@ +climate.downstairs: + friendly_name: 'Nest Downstairs' + icon: mdi:air-conditioner +climate.upstairs: + friendly_name: 'Nest Upstairs' + icon: mdi:air-conditioner + \ No newline at end of file diff --git a/customize/others.yaml b/customize/others.yaml new file mode 100755 index 00000000..41bdac0b --- /dev/null +++ b/customize/others.yaml @@ -0,0 +1,24 @@ +sensor.hue_hub: + icon: mdi:router-wireless +device_tracker.hue_hub: + hidden: true + +sensor.rachio: + icon: mdi:spray +device_tracker.rachio: + hidden: true + +sensor.alexa_echo: + icon: mdi:amazon +device_tracker.alexa_echo: + hidden: true + +sensor.skybell: + icon: mdi:camera-front +device_tracker.skybell: + hidden: true + +sensor.samsungtv: + icon: mdi:television +device_tracker.samsungtv: + hidden: true \ No newline at end of file diff --git a/customize/rokus.yaml b/customize/rokus.yaml new file mode 100755 index 00000000..bef5069c --- /dev/null +++ b/customize/rokus.yaml @@ -0,0 +1,11 @@ +media_player.roku_1gj361038190: + friendly_name: 'Downstairs Main Roku' +media_player.roku_1gs3ac111661: + friendly_name: 'Upstairs Roku' +media_player.roku_2N006T621680: + friendly_name: 'Bedroom Roku' + +device_tracker.tablotv: + hidden: true +sensor.tablotv: + icon: mdi:television-guide \ No newline at end of file diff --git a/customize/wii.yaml b/customize/wii.yaml new file mode 100755 index 00000000..1228fd2c --- /dev/null +++ b/customize/wii.yaml @@ -0,0 +1,4 @@ +sensor.wii: + icon: mdi:gamepad-variant +device_tracker.wii: + hidden: true \ No newline at end of file diff --git a/device_tracker/nmap.yaml b/device_tracker/nmap.yaml new file mode 100755 index 00000000..276a76fb --- /dev/null +++ b/device_tracker/nmap.yaml @@ -0,0 +1,4 @@ +- platform: nmap_tracker + hosts: 192.168.10.100-254 + track_new_devices: no + # consider_home: 1800 - Added to known_devices.yaml instead on a device by device basis. \ No newline at end of file diff --git a/scene/tv_time.yaml b/scene/tv_time.yaml new file mode 100755 index 00000000..7697a412 --- /dev/null +++ b/scene/tv_time.yaml @@ -0,0 +1,40 @@ +- name: Living Room TV Time + entities: + light.dinette_light_1: + state: off + transition: 10 + light.dinette_light_2: + state: off + transition: 10 + light.living_room_front_left: + state: off + transition: 10 + light.living_room_front_right: + state: off + transition: 10 + light.living_room_slider: + state: off + transition: 10 + light.living_room_back_right: + state: on + transition: 10 + brightness: 1 + light.living_room_back_left: + state: on + transition: 40 + brightness: 1 + light.living_room_couch_1: + state: on + transition: 400 + xy_color: [0.6621,0.3023] + brightness: 255 + light.living_room_couch_2: + state: on + transition: 400 + xy_color: [0.6621,0.3023] + brightness: 255 + light.couch_tv_light: + state: on + transition: 400 + xy_color: [0.6621,0.3023] + brightness: 100 diff --git a/sensor/devices.yaml b/sensor/devices.yaml new file mode 100755 index 00000000..e5bb800f --- /dev/null +++ b/sensor/devices.yaml @@ -0,0 +1,66 @@ +- platform: template + sensors: + wii: + friendly_name: 'Wii' + value_template: >- + {%- if is_state("device_tracker.wii", "home") %} + Online + {% else %} + Offline + {%- endif %} + tablotv: + friendly_name: 'Tablo TV' + value_template: >- + {%- if is_state("device_tracker.tablotv", "home") %} + Online + {% else %} + Offline + {%- endif %} + hue_hub: + friendly_name: 'Hue Hub' + value_template: >- + {%- if is_state("device_tracker.hue_hub", "home") %} + Online + {% else %} + Offline + {%- endif %} + alexa_echo: + friendly_name: 'Alexa Echo' + value_template: >- + {%- if is_state("device_tracker.alexa_echo", "home") %} + Online + {% else %} + Offline + {%- endif %} + circle: + friendly_name: 'Disney Circle' + value_template: >- + {%- if is_state("device_tracker.circle", "home") %} + Online + {% else %} + Offline + {%- endif %} + rachio: + friendly_name: 'Rachio Sprinklers' + value_template: >- + {%- if is_state("device_tracker.rachio", "home") %} + Online + {% else %} + Offline + {%- endif %} + skybell: + friendly_name: 'Skybell Doorbell' + value_template: >- + {%- if is_state("device_tracker.skybell", "home") %} + Online + {% else %} + Offline + {%- endif %} + samsungtv: + friendly_name: 'Samsung TV' + value_template: >- + {%- if is_state("device_tracker.samsungtv", "home") %} + Online + {% else %} + Offline + {%- endif %} diff --git a/sensor/speedtest.yaml b/sensor/speedtest.yaml new file mode 100755 index 00000000..9312edd0 --- /dev/null +++ b/sensor/speedtest.yaml @@ -0,0 +1,10 @@ +- platform: speedtest + minute: 30 + hour: + - 0 + - 6 + - 12 + - 18 + monitored_conditions: + - download + - upload diff --git a/sensor/systemmonitor.yaml b/sensor/systemmonitor.yaml new file mode 100755 index 00000000..6f58bbca --- /dev/null +++ b/sensor/systemmonitor.yaml @@ -0,0 +1,52 @@ +- platform: command_line + command: "grep -c invalidpassword /home/hass/.homeassistant/home-assistant.log" + name: badlogin + +- platform: systemmonitor + resources: + # - type: last_boot + - type: since_last_boot + +- platform: template + sensors: + since_last_boot_templated: + value_template: >- + {%- set slb = states.sensor.since_last_boot.state.split(' ') -%} + {%- set count = slb | length -%} + {%- set hms = slb[count - 1] -%} + {%- set hms_trimmed = hms.split('.')[0] -%} + {%- set hms_split = hms_trimmed.split(':') -%} + {%- set hours = hms_split[0] | int -%} + {%- set minutes = hms_split[1] | int -%} + {%- set seconds = hms_split[2] | int -%} + + {%- if count == 3 -%} + {{ slb[0] ~ ' ' ~ slb[1] ~ ' ' }} + {%- endif -%} + {%- if hours > 0 -%} + {%- if hours == 1 -%} + 1 hour + {%- else -%} + {{ hours }} hours + {%- endif -%} + {%- endif -%} + {%- if minutes > 0 -%} + {%- if hours > 0 -%} + {{ ', ' }} + {%- endif -%} + {%- if minutes == 1 -%} + 1 minute + {%- else -%} + {{ minutes }} minutes + {%- endif -%} + {%- endif -%} + {%- if seconds > 0 -%} + {%- if hours > 0 or minutes > 0 -%} + {{ ', ' }} + {%- endif -%} + {%- if seconds == 1 -%} + 1 second + {%- else -%} + {{ seconds }} seconds + {%- endif -%} + {%- endif -%} diff --git a/sensor/weather.yaml b/sensor/weather.yaml new file mode 100755 index 00000000..061a9c1c --- /dev/null +++ b/sensor/weather.yaml @@ -0,0 +1,16 @@ +- platform: darksky + api_key: !secret forecast_key + + monitored_conditions: + - summary +# - precip_type + - precip_intensity + - temperature +# - dew_point +# - wind_speed +# - wind_bearing +# - cloud_cover + - humidity +# - pressure +# - visibility +# - ozone \ No newline at end of file diff --git a/shell_scripts/homebridge_commands.txt b/shell_scripts/homebridge_commands.txt new file mode 100755 index 00000000..74d002da --- /dev/null +++ b/shell_scripts/homebridge_commands.txt @@ -0,0 +1,6 @@ +# Restart Homebridge on HASS start +# shell_command: + # restart_homebridge: 'sudo su pi -c "pm2 restart homebridge"' + # start_homebridge: 'sudo su pi -c "pm2 start homebridge"' + # stop_homebridge: 'sudo su pi -c "pm2 stop homebridge"' + \ No newline at end of file diff --git a/switch/rf_outlets.yaml b/switch/rf_outlets.yaml new file mode 100755 index 00000000..26fa0cac --- /dev/null +++ b/switch/rf_outlets.yaml @@ -0,0 +1,18 @@ +- platform: rpi_rf + gpio: 17 + switches: + Outlet_Living_Room: + protocol: 1 + pulselength: 186 + code_on: 5265155 + code_off: 5265164 + Outlet_2: + protocol: 1 + pulselength: 186 + code_on: 5264835 + code_off: 5264844 + Outlet_Garage: + protocol: 1 + pulselength: 186 + code_on: 5264691 + code_off: 5264700 \ No newline at end of file