Inital Commit

This commit is contained in:
2022-10-11 15:40:40 +13:00
commit 7089991005
50 changed files with 1313 additions and 0 deletions

0
automations.yaml Normal file
View File

View File

@@ -0,0 +1,21 @@
- id: "1630652622875"
alias: Turn off Main TV
description: ""
trigger:
- platform: mqtt
topic: viewroad-commands/maintv/action
payload: "OFF"
condition: []
action:
#- type: toggle
# device_id: d75c9f1db62bd7d599394dfcacedfa61
# entity_id: remote.viera_gt30_series
# domain: remote
- alias: "Send remote command (Power) to TV"
service: remote.send_command
data:
command: "Power"
target:
#device_id: d75c9f1db62bd7d599394dfcacedfa61
entity_id: remote.viera_gt30_series
mode: single

View File

@@ -0,0 +1,10 @@
- id: quiet_time_settings_to_mqtt
alias: Publish quiet time value to mqtt
trigger:
platform: state
entity_id: input_boolean.quiet_time
action:
service: mqtt.publish
data_template:
payload: "{{trigger.to_state.state}}"
topic: viewroad-status/homeassistant/quiet-time

View File

@@ -0,0 +1,26 @@
- id: do_random_actions_when_away
alias: Activate Random Actions for Security
mode: parallel # Enable parallel executions
trigger:
- platform: time_pattern
minutes: /5
condition:
alias: "Away routine active, nearly sunset, and all family not home"
condition: and
conditions:
- condition: sun
after: sunset
after_offset: -00:30:00 #30 mins before
- condition: state
entity_id: input_boolean.away_occupied_routine
state: "on"
- condition: state
entity_id: group.family_away
state: "not_home"
action:
service: script.light_duration
data:
# Pass randomly selected light from "group.simulation_lights" as script variable "light"
light: "{{states.group.simulation_lights.attributes.entity_id | random}}"
# random value between 5 & 29
duration: "00:{{ '{:02}'.format(range(5,29) | random | int) }}:00"

View File

@@ -0,0 +1,15 @@
- id: "1635929281159"
alias: Weekly Low battery level detection
description: ""
use_blueprint:
path: sbyx/low-battery-level-detection-notification-for-all-battery-sensors.yaml
input:
day: 1
time: "21:00:00"
actions:
- service: notify.pushover_notifications
data:
message: >
Weekly Battery Check. Low Devices:
{{sensors}}
title: View Road Sensors

View File

@@ -0,0 +1,32 @@
- id: notify_if_batteries_are_low
alias: Daily alert that zigbee batteries Are Low
initial_state: true
trigger:
- platform: time
at: "19:00:00"
condition:
- condition: or
conditions:
- condition: template
value_template: >
{% set min_battery_level = 20 -%}
{% set ns = namespace(found=false) -%}
{% for entity_id in states.group.battery_levels.attributes.entity_id -%}
{% set parts = entity_id.split('.') -%}
{% if (states(entity_id) | replace("%","") | int) < min_battery_level -%}
{% set ns.found = true -%}
{% endif -%}
{% endfor -%}
{{ ns.found }}
action:
- service: notify.pushover_notifications
data:
title: View Road Sensors
message: >
{%- set min_battery_level = 20 -%}
{%- for entity_id in states.group.battery_levels.attributes.entity_id -%}
{%- set parts = entity_id.split('.') -%}
{%- if (states(entity_id) | replace("%","") | int) < min_battery_level -%}
{{ states[parts[0]][parts[1]].name }} level is {{ states(entity_id) }}%.{{ '\n' }}
{%- endif -%}
{%- endfor -%}

61
configuration.yaml Normal file
View File

@@ -0,0 +1,61 @@
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
frontend:
themes: !include_dir_merge_named themes
homeassistant:
customize: !include customize.yaml
packages: !include_dir_named packages
#group: !include groups.yaml
group: !include_dir_merge_named group/
automation: !include_dir_merge_list automations/
automation UI: !include automations.yaml
script: !include_dir_merge_named scripts/
#script UI: !include scripts.yaml
scene: !include scenes.yaml
#mqtt merged: !include_dir_merge_named mqtt/
#sensor merged: !include_dir_merge_list sensor/
sensor: !include_dir_merge_list sensor/
logger:
default: info
logs:
custom_components.hacs: debug
custom_components.evnex: debug
evnex: debug
# mqtt broker
#mqtt:
# broker: !secret mqtt1_broker
# port: !secret mqtt1_port
device_tracker:
- platform: bluetooth_le_tracker
input_boolean:
foxhole_occupied:
name: Foxhole Guest Occupied
icon: mdi:briefcase-plus-outline
quiet_time:
name: Quiet time for no notifications
icon: mdi:shield-moon
away_occupied_routine:
name: Automation for Lights etc when away
icon: mdi:shield-lock
rest_command:
chores1_request:
url: !secret grocy_api_uri_chore6
method: PUT
headers:
accept: "*/*"
GROCY-API-KEY: !secret grocy_api_key
content_type: "application/json"
payload: '{
"name" : "{{ name }}" ,
"next_execution_assigned_to_user_id" : "{{ assigned_to }}"
}'
# payload: '{"name" : "{{ name }}" , "next_estimated_execution_time" : "{{ next_time }}", "next_execution_assigned_to_user_id" : "{{ assigned_to }}" }'
verify_ssl: false

9
customize.yaml Normal file
View File

@@ -0,0 +1,9 @@
sensor.dryer_finished:
icon: mdi:tumble-dryer-alert
sensor.washing_machine_finished:
icon: mdi:washing-machine-alert
sensor.dishwasher_finished:
icon: mdi:dishwasher-alert
sensor.pets_fed:
friendly_name: Pets Fed
icon: mdi:paw

View File

@@ -0,0 +1,135 @@
#############################################
# ESPHome
#############################################
esphome:
name: bt-fridge-temps
#############################################
# Specific board for ESPHome device
#############################################
esp32:
board: nodemcu-32s
#############################################
# ESPHome Logging Enable
#############################################
logger:
#############################################
# Enable the Home Assistant API
#############################################
api:
encryption:
key: !secret bt-fridge-temps_api_key
#############################################
# Enable Over the Air Update Capability
# Safe mode will detect boot loops
#############################################
ota:
safe_mode: true
password: !secret bt-fridge-temps_ota_pass
#############################################
# Use Wifi
#############################################
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Details for fallback hotspot (captive portal)
# in case wifi connection fails
ap:
ssid: "Bt-Fridge-Temps Fallback Hotspot"
password: !secret fallback_ap_password
#############################################
# Fallback captive portal
#############################################
captive_portal:
#############################################
# Web Portal for display and monitoring
#############################################
web_server:
port: 80
auth:
username: !secret web_server_username
password: !secret web_server_password
#############################################
# MQTT Monitoring
#############################################
mqtt:
broker: !secret mqtt_server
topic_prefix: esphome/bt-fridge-temps
username: !secret mqtt_username
password: !secret mqtt_password
#############################################
#############################################
# MAIN SENSORS
#############################################
#############################################
#############################################
# Bluetooth
#############################################
bluetooth_proxy:
esp32_ble_tracker:
###################################################################################
## Help with Mi Bluetooth Temp Sensors
## Youtube Howto https://www.youtube.com/watch?v=l5ea7lQWpMk&t=0s
## https://pvvx.github.io/ATC_MiThermometer/TelinkMiFlasher.html
## https://esphome.io/components/sensor/xiaomi_ble.html?highlight=ble#lywsd03mmc
## Tasmota Info: https://tasmota.github.io/docs/Bluetooth/
###################################################################################
sensor:
- platform: xiaomi_lywsd03mmc
# ATC_DE944A
mac_address: "A4:C1:38:DE:94:4A"
#dummy bindkey
bindkey: "eef418daf699a0c188f3bfd17e4565d5"
temperature:
name: "Fridge Temperature (BTT01)"
humidity:
name: "Fridge Humidity (BTT01)"
battery_level:
name: "Fridge Monitor Battery Level (BTT01)"
- platform: xiaomi_lywsd03mmc
# ATC_B32B0C
mac_address: "A4:C1:38:B3:2B:0C"
#dummy bindkey
bindkey: "eef418daf699a0c188f3bfd17e4565d8"
temperature:
name: "Freezer Temperature (BTT02)"
humidity:
name: "Freezer Humidity (BTT02)"
battery_level:
name: "Freezer Monitor Battery Level (BTT02)"
- platform: xiaomi_lywsd03mmc
# ATC_D90603
mac_address: "A4:C1:38:D9:06:03"
#dummy bindkey
bindkey: "eef418daf699a0c188f3bfd17e4565d7"
temperature:
name: "Lower Fridge Temperature (BTT03)"
humidity:
name: "Lower Fridge Humidity (BTT03)"
battery_level:
name: "Lower Fridge Battery Level (BTT03)"
- platform: xiaomi_lywsd03mmc
# ATC_81ECB0
mac_address: "A4:C1:38:81:EC:B0"
#dummy bindkey
bindkey: "eef418daf699a0c188f3bfd17e4565d6"
temperature:
name: "Lower Freezer Temperature (BTT04)"
humidity:
name: "Lower Freezer Humidity (BTT04)"
battery_level:
name: "Lower Freezer Monitor Battery Level (BTT04)"

133
esphome/esp-leafbat2.yaml Normal file
View File

@@ -0,0 +1,133 @@
#############################################
# Common
#############################################
substitutions:
devicename: esp-leafbat2
nice_devicename: "Leaf Battery Monitor 2"
#############################################
# ESPHome
#############################################
esphome:
name: $devicename
########################################
# Specific board for ESPHome device
########################################
esp8266:
board: d1_mini
#############################################
# ESPHome Logging Enable
#############################################
logger:
########################################
# Enable the Home Assistant API
########################################
api:
encryption:
key: !secret esp-leafbat2_api_key
########################################
# Enable Over the Air Update Capability
# Safe mode will detect boot loops
########################################
ota:
safe_mode: true
password: !secret esp-leafbat2_ota_pass
########################################
# Use Wifi
# (credentials are in secrets file)
########################################
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Details for fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esp-Leafbat2 Fallback Hotspot"
password: !secret fallback_ap_password
# Static IP (for lower power/quicker on time)
manual_ip:
static_ip: !secret esp-leafbat2_static_ip
gateway: !secret esp-leafbat2_gateway
subnet: !secret esp-leafbat2_subnet
#############################################
# Fallback captive portal
#############################################
captive_portal:
########################################
# Web Portal for display and monitoring
########################################
web_server:
port: 80
auth:
username: !secret web_server_username
password: !secret web_server_password
########################################
# MQTT Monitoring
########################################
mqtt:
broker: !secret mqtt_server
topic_prefix: esphome/esp-leafbat2
username: !secret mqtt_username
password: !secret mqtt_password
#
# Availability Topic
#birth_message:
# topic: esphome/esp-leafbat2/availability
# payload: online
#will_message:
# topic: esphome/esp-leafbat2/availability
# payload: offline
# A way to prevent deep sleep using MQTT command
on_message:
- topic: viewroad-commands/leafbat2/deepsleepoff
payload: 'ON'
then:
- deep_sleep.prevent: deep_sleep_1
- topic: viewroad-commands/leafbat2/deepsleepon
payload: 'ON'
then:
- deep_sleep.enter: deep_sleep_1
########################################
# Deep Sleep
########################################
deep_sleep:
run_duration: 20s
sleep_duration: 10min
id: deep_sleep_1
#############################################
#############################################
# MAIN SENSORS
#############################################
#############################################
sensor:
# Quality of Wifi in dBm
- platform: wifi_signal
name: "WiFi Signal"
update_interval: 20s
retain: true
# Analog sensor for voltage reading (A0)
- platform: adc
pin: A0
name: "Battery Voltage"
update_interval: 20s
retain: true
filters:
- multiply: 18.52 # trial and error calc/measure
- calibrate_linear:
- 5.99 -> 6.0
- 11.98 -> 11.99
- 16.98 -> 16.98
#name: "Battery Voltage"
# Optional variables:
#retain: true

View File

@@ -0,0 +1,129 @@
#############################################
# ESPHome
#############################################
esphome:
name: "esp-mainovenmonitor"
#############################################
# Specific board for ESPHome device
#############################################
esp8266:
board: sonoff_basic
#############################################
# ESPHome Logging Enable
#############################################
# NOTE: Baudrate set to 0 as we are using the UART with PZEM
logger:
baud_rate: 0
#############################################
# Enable the Home Assistant API
#############################################
api:
encryption:
key: !secret esp-mainovenmonitor_api_key
#############################################
# Enable Over the Air Update Capability
# Safe mode will detect boot loops
#############################################
ota:
safe_mode: true
password: !secret esp-mainovenmonitor_ota_pass
#############################################
# Use Wifi
#############################################
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Details for fallback hotspot (captive portal)
# in case wifi connection fails
ap:
ssid: "Mainovenmonitor Fallback Hotspot"
password: !secret fallback_ap_password
# manual_ip:
# static_ip: 192.168.x.x
# gateway: 192.168.X.x
# subnet: 255.255.255.0
#############################################
# Fallback captive portal
#############################################
captive_portal:
#############################################
# Web Portal for display and monitoring
#############################################
web_server:
port: 80
auth:
username: !secret web_server_username
password: !secret web_server_password
#############################################
# MQTT Monitoring
#############################################
mqtt:
broker: !secret mqtt_server
topic_prefix: esphome/esp-mainovenmonitor
username: !secret mqtt_username
password: !secret mqtt_password
#############################################
#############################################
# MAIN SENSORS
#############################################
#############################################
# PEZEM4 Power Monitoring
# https://esphome.io/components/sensor/pzemac.html
#############################################
uart:
rx_pin: GPIO3
tx_pin: GPIO1
#tx_pin: RX
#rx_pin: TX
baud_rate: 9600
stop_bits: 1
modbus:
sensor:
- platform: pzemac
current:
name: "Main Oven Current"
voltage:
name: "Main Oven Voltage"
energy:
name: "Main Oven Energy"
power:
name: "Main Oven Power"
frequency:
name: "Main Oven Mains Frequency"
power_factor:
name: "Main Oven Power Factor"
update_interval: 10s
########################################
########################################
# Relay Output (on sonoff basic)
switch:
- platform: gpio
name: "Main Oven Disable"
pin: GPIO12
#button:
# - platform: restart
# name: "Main Oven ESPHome Restart"
# LED Flashes on errors or warnings
# https://esphome.io/components/status_led.html
status_led:
pin:
number: GPIO13
inverted: true

View File

@@ -0,0 +1,94 @@
#############################################
# ESPHome
#############################################
esphome:
name: esp-netcupfan2
########################################
# Specific board for ESPHome device
########################################
esp8266:
board: d1_mini
#############################################
# ESPHome Logging Enable
#############################################
logger:
#############################################
# Enable the Home Assistant API
#############################################
api:
encryption:
key: !secret esp-netcupfan2_api_key
#############################################
# Enable Over the Air Update Capability
# Safe mode will detect boot loops
#############################################
ota:
safe_mode: true
password: !secret esp-netcupfan2_ota_pass
#############################################
# Use Wifi
#############################################
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Details for fallback hotspot
# in case wifi connection fails
ap:
ssid: "Netcupfan2 Fallback Hotspot"
password: !secret fallback_ap_password
#############################################
# Fallback captive portal
#############################################
captive_portal:
#############################################
# Web Portal for display and monitoring
#############################################
web_server:
port: 80
auth:
username: !secret web_server_username
password: !secret web_server_password
#############################################
# MQTT Monitoring
#############################################
mqtt:
broker: !secret mqtt_server
topic_prefix: esphome/esp-netcupfan2
username: !secret mqtt_username
password: !secret mqtt_password
#############################################
#############################################
# MAIN SENSORS
#############################################
#############################################
# Relay Output on a GPIO Pin
switch:
- platform: gpio
name: "Relay_Main"
pin: GPIO15
# Allows a fan control point in Home Assistant
fan:
- platform: speed
output: pwm_output
name: "Net Cupboard Fan 2 Speed"
speed_count: 500
# PWM Fan Output on the GPIO Pin
output:
- platform: esp8266_pwm
pin: GPIO16
frequency: 25000 Hz
id: pwm_output

View File

@@ -0,0 +1,9 @@
basement_lights:
name: Basement Lights
entities:
- switch.tasmo_s4chan_4231_underhouselights_a
- switch.tasmo_s4chan_4231_underhouselights_b
- switch.tasmo_ks811t_7846_officelights2_a
- switch.tasmo_ks811t_7846_officelights2_b
- switch.tasmo_sdual_7681_officelights1_a
- switch.tasmo_sdual_7681_officelights1_b

30
group/battery_levels.yaml Normal file
View File

@@ -0,0 +1,30 @@
battery_levels:
name: Battery Levels
entities:
# Smoke Detectors (CR123A)
#- sensor.main_lounge_smoke_detector_zsm01_battery
#- sensor.downstairs_lounge_lounge_smoke_detector_zsm02_battery
# Leak Detection (Button cell 2032)
- sensor.main_kitchen_sink_leak_zlk01_battery
- sensor.guest_bathroom_laundry_sink_leak_zlk02_battery
- sensor.basement_laundry_floor_leak_zlk03_battery
- sensor.downstairs_kitchen_sink_leak_zlk04_battery
# Temp, Humidity Sensors (Button cell 2032)
- sensor.master_bedroom_temperature_zth01_battery
- sensor.bedroom_2_temperature_zth02_battery
- sensor.bedroom_3_temperature_zth03_battery
- sensor.main_bathroom_temperature_zth04_battery
- sensor.storage_loft_temperature_zth05_battery
- sensor.downstairs_bedroom_1_temperature_zth06_battery
# Temp, Humidity Sensors (2x AAA Batteries)
- sensor.humidor_environment_zth07_battery
- sensor.main_kitchen_fridge_temp_zth08_battery
# Multisensor Sensors (2X CR123A OR 5V MicroUSB)
#- sensor.main_kitchen_multisensor_zms01_battery
- sensor.data_cupboard_multisensor_zms02_battery
# LCD Temp, Humidity Sensors (2x AAA Batteries)
- sensor.office_lcd_temperature_ztl01_battery
- sensor.master_bedroom_lcd_temperature_ztl02_battery
- sensor.downstairs_lounge_lcd_temperature_ztl03_battery
# Sonoff PIR (CR2450)
- sensor.piano_pir_zir01_battery

View File

@@ -0,0 +1,6 @@
family_away:
name: All Family Members Away
entities:
- !secret person_1
- !secret person_2
- !secret person_3

15
group/foxhole_lights.yaml Normal file
View File

@@ -0,0 +1,15 @@
foxhole_lights:
name: Foxhole Lights
# Doesn't include the outdoor switch lights
entities:
- switch.tasmo_ks811t_0707_downstloun_2a # Lounge Main Lights
- switch.tasmo_ks811t_0707_downstloun_2b # Lounge Wall Lights
- switch.tasmo_ks811s_3136_downstbed2_1a # Craft Room Lights
- switch.tasmo_ks811t_3642_downstbed1_1a # Main Bedroom, Main Lights
- switch.tasmo_ks811t_3642_downstbed1_1b # Main Bedroom, Wardrobe Light
- switch.tasmo_ks811t_3642_downstbed1_1c # Main Bedroom, Bedside switch
- switch.tasmo_ks811t_2192_downstkitch_1a # Kitchen Entry Lights
- switch.tasmo_ks811t_2192_downstkitch_1b # Kitchen Main Lights
- switch.tasmo_ks811t_2192_downstkitch_1c # Kitchen (Unused, future strip lights)
- switch.tasmo_ks811t_1181_downstbath_a # Downstairs Bathroom Main Lights
- switch.tasmo_ks811t_1181_downstbath_b # Downstairs Bathroom Mirror Lights

View File

@@ -0,0 +1,21 @@
simulation_lights:
name: Simulation Lights
# Lights included in 'away from home' random patterns
entities:
- switch.tasmo_ks811d_1242_entrance_a # Entranceway Main Lights
- switch.tasmo_ks811d_0302_entrybath_a # Entranceway Guest Bathroom Lights
- switch.tasmo_ks811d_6110_kitchen_a # Main Kitchen, Main Lights
- switch.tasmo_ks811d_6110_kitchen_b # Main Kitchen, Bench Lights
- switch.tasmo_ks811s_2940_hallway_1a # Hallway Main Lights
- switch.tasmo_ks811d_1701_stairs_2a # Stairs, Lower ceiling lights
- switch.tasmo_ks811t_0702_lounge_3a # Lounge Main, South
- switch.tasmo_ks811t_0702_lounge_3b # Lounge Main, Middle
- switch.tasmo_ks811t_0702_lounge_3c # Lounge Main, North (above stairs)
- switch.tasmo_ks811t_0707_downstloun_2a # Foxhole Lounge Main Lights
- switch.tasmo_ks811t_0707_downstloun_2b # Foxhole Lounge Wall Lights
- switch.tasmo_ks811s_3136_downstbed2_1a # Foxhole Craft Room Lights
- switch.tasmo_ks811t_3642_downstbed1_1a # Foxhole Main Bedroom, Main Lights
- switch.tasmo_ks811t_2192_downstkitch_1a # Foxhole Kitchen Entry Lights
- switch.tasmo_ks811t_2192_downstkitch_1b # Foxhole Kitchen Main Lights
- switch.tasmo_ks811t_1181_downstbath_a # Foxhole Downstairs Bathroom Main Lights
- switch.tasmo_s4chan_4231_underhouselights_b # Underhouse Main Lights

1
groups.yaml Normal file
View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,11 @@
mqtt:
sensor:
- unique_id: washing_machine_finished
name: "Washing Machine Finished"
state_topic: "viewroad-status/activityfeed/washercomplete"
- unique_id: dryer_finished
name: "Dryer Finished"
state_topic: "viewroad-status/activityfeed/dryercomplete"
- unique_id: dishwasher_finished
name: "Dishwasher Finished"
state_topic: "viewroad-status/activityfeed/dishwashercomplete"

View File

@@ -0,0 +1,24 @@
mqtt:
switch:
- unique_id: lounge_blinds_control
name: "Lounge Blinds Control"
state_topic: "viewroad-status/blinds/lounge-verticalblinds"
command_topic: "viewroad-commands/blinds/lounge-verticalblinds"
payload_off: "off"
payload_on: "on"
state_on: "on"
state_off: "off"
icon: mdi:blinds
retain: false
automation:
- id: lounge_blinds_control_switch
alias: Publish lounge blind control to mqtt
trigger:
platform: state
entity_id: input_boolean.lounge_blinds
action:
service: mqtt.publish
data_template:
payload: "{{trigger.to_state.state}}"
topic: viewroad-status/blinds/lounge-verticalblinds

View File

@@ -0,0 +1,6 @@
mqtt:
binary_sensor:
- unique_id: front_door_movement_camera_corner
name: "Front Door Movement"
state_topic: "viewroad-status/cctv/front_door_motion"
icon: mdi:exit-run

35
packages/covid_count.yaml Normal file
View File

@@ -0,0 +1,35 @@
var:
covid_daily:
friendly_name: "Daily Covid count"
initial_value: 0
icon: mdi:virus-outline
covid_yesterday_total:
friendly_name: "Yesterdays NZ Cumulative Total Covid Cases"
initial_value: 0
icon: mdi:virus-outline
automation:
- id: add_covid_confirmed_stats_only_if_increases
alias: add_covid_confirmed_stats_only_if_increases
#description:
# "Check new state of sensor.new_zealand_coronavirus_confirmed and store it
# in input_number.new_zealand_coronavirus_confirmed_previous_value if it has increased"
trigger:
- platform: state
entity_id: sensor.new_zealand_coronavirus_confirmed
condition:
- condition: template
value_template:
"{{ (states('sensor.new_zealand_coronavirus_confirmed') | float
> states('var.covid_yesterday_total') | float) }}"
action:
- service: var.set
data_template:
entity_id: var.covid_daily
value:
"{{ states('sensor.new_zealand_coronavirus_confirmed') | float - states('var.covid_yesterday_total')
| float }}"
- service: var.set
data_template:
entity_id: var.covid_yesterday_total
value: "{{ states('sensor.new_zealand_coronavirus_confirmed') | float }}"

View File

@@ -0,0 +1,21 @@
mqtt:
sensor:
- unique_id: view_road_power_now
name: "Power Now"
state_topic: "viewroad-status/energy/PowerTotals"
unit_of_measurement: "kW"
- unique_id: view_road_power_now_red
name: "Power Now (Red)"
state_topic: "tele/tasmo-wemosd1-7280-powermon-1/SENSOR"
unit_of_measurement: "kW"
value_template: "{{ value_json.ENERGY.Power[0] }}"
- unique_id: view_road_power_now_white
name: "Power Now (White)"
state_topic: "tele/tasmo-wemosd1-7280-powermon-1/SENSOR"
unit_of_measurement: "kW"
value_template: "{{ value_json.ENERGY.Power[1] }}"
- unique_id: view_road_power_now_blue
name: "Power Now (Blue)"
state_topic: "tele/tasmo-wemosd1-7280-powermon-1/SENSOR"
unit_of_measurement: "kW"
value_template: "{{ value_json.ENERGY.Power[2] }}"

View File

@@ -0,0 +1,10 @@
mqtt:
switch:
- unique_id: mollies.internet
name: "Mollie's Internet Blocking"
state_topic: "viewroad-status/firewall/block-unblock-mollie-iphone7"
command_topic: "viewroad-commands/firewall/block-unblock-mollie-devices"
payload_off: "Unblocked"
payload_on: "Blocked"
icon: mdi:web
retain: false

View File

@@ -0,0 +1,19 @@
mqtt:
sensor:
- unique_id: gas_heater_operating
name: "Gas Heater Operating"
state_topic: "viewroad-status/gasheater/operating"
switch:
- unique_id: gasheater_switch
name: "Gas Heater"
state_topic: "viewroad-status/gasheater/operating"
command_topic: "viewroad-commands/gasheater/onoff"
#availability:
# - topic: "home/bedroom/switch1/available"
payload_on: "ON"
payload_off: "OFF"
state_on: "ON"
state_off: "OFF"
optimistic: false
qos: 0
# retain: true

View File

@@ -0,0 +1,55 @@
mqtt:
sensor:
- unique_id: kettle.temp
name: "Kettle Temperature"
state_topic: "tele/tasmo-kkettle-3773-portable/RESULT"
availability_topic: "tele/tasmo-kkettle-3773-portable/LWT"
payload_available: "Online"
payload_not_available: "Offline"
value_template: >
{% if value_json.TuyaReceived['5'].DpIdData %}
{{ value_json.TuyaReceived['5'].DpIdData | int(base=16) }}
{% else %}
{{ states('sensor.kettle_temp') }}
{% endif %}
unit_of_measurement: "°C"
switch:
- unique_id: kettle.power
name: kettle
state_topic: "stat/tasmo-kkettle-3773-portable/POWER"
command_topic: "cmnd/tasmo-kkettle-3773-portable/POWER"
availability_topic: "tele/tasmo-kkettle-3773-portable/LWT"
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
retain: false
input_select:
kettle_set:
name: Keep Kettle Warm
initial: "OFF"
options:
- "OFF"
- "40°C"
- "50°C"
- "60°C"
- "80°C"
- "90°C"
automation:
- id: set_the_kettle
initial_state: true
alias: Set the Kettle
trigger:
platform: state
entity_id: input_select.kettle_set
action:
service: mqtt.publish
data:
topic: cmnd/tasmo-kkettle-3773-portable/TuyaSend4
payload: '{% set mapping = { "OFF":"102,5", "40°C":"102,0",
"50°C":"102,1", "60°C":"102,2", "80°C":"102,3",
"90°C":"102,4" } %} {% set dta = trigger.to_state.state %}
{{ mapping[dta] }}
'

View File

@@ -0,0 +1,5 @@
media_player:
# MPD Media Player on Lounge Touchscreen
platform: mpd
host: !secret lounge_mpd_player
scan_interval: 1

View File

@@ -0,0 +1,62 @@
mqtt:
sensor:
- unique_id: office_media_button_1
name: "Office Media Button"
state_topic: "tele/tasmo-zigb-6440-1/9CB5/SENSOR"
unit_of_measurement: "Press"
value_template: "{{ value_json.ZbReceived.Office_Media_Button.Power }}"
automation:
- id: "1629271273952"
alias: Pause Office TV on Media Button
description: ""
trigger:
- platform: state
entity_id: sensor.office_media_button
to: "1"
condition: []
action:
- service: media_player.media_pause
target:
device_id: abb6b5a6b4e4925dcb3a77ea2c293eaa
mode: single
- id: "1629271457675"
alias: Play Office TV on Media Button
description: ""
trigger:
- platform: state
entity_id: sensor.office_media_button
to: "2"
condition: []
action:
- service: media_player.media_play
target:
device_id: abb6b5a6b4e4925dcb3a77ea2c293eaa
mode: single
- id: "1629271273958"
alias: Pause office TV on MQTT
description: ""
trigger:
- platform: mqtt
topic: viewroad-commands/officetv/action
payload: pause
encoding: utf-8
condition: []
action:
- service: media_player.media_pause
target:
device_id: abb6b5a6b4e4925dcb3a77ea2c293eaa
mode: single
- id: "1630969028384"
alias: Skip Forward 30 Seconds on Media Button
description: ""
trigger:
- platform: state
entity_id: sensor.office_media_button
to: "3"
condition: []
action:
- service: media_player.media_seek
data:
seek_position: 30
mode: single

21
packages/pet_feeding.yaml Normal file
View File

@@ -0,0 +1,21 @@
mqtt:
sensor:
- unique_id: pets_fed
name: "Pets Fed"
state_topic: "viewroad-status/activityfeed/petsfed"
- unique_id: hours_since_cat_fed
name: "Hours Since Cat Fed"
state_topic: "viewroad-tele/petfeeding/hoursSinceCatFed"
unit_of_measurement: "Hours"
- unique_id: hours_since_zorro_fed
name: "Hours Since Zorro Fed"
state_topic: "viewroad-tele/petfeeding/hoursSinceDogFed"
unit_of_measurement: "Hours"
- unique_id: hours_since_water_filled
name: "Hours Since Pet Water Filled"
state_topic: "viewroad-tele/petfeeding/hoursSinceWaterFilled"
unit_of_measurement: "Hours"
- unique_id: hours_since_pets_fed
name: "Hours Since Pets Fed"
state_topic: "viewroad-tele/petfeeding/averageHoursSincePetsFed"
unit_of_measurement: "Hours"

View File

@@ -0,0 +1,45 @@
mqtt:
sensor:
- unique_id: piano.lastfinish
name: "Last Piano Practice Complete"
state_topic: "viewroad-status/activityfeed/pianopractice"
- unique_id: piano.lastpracticeduration
state_topic: "viewroad-status/piano/lastPracticeDuration"
name: "Last Piano Practice Time"
unit_of_measurement: "mins"
- unique_id: piano.todayspracticeduration
state_topic: "viewroad-status/piano/todayPracticeDuration"
name: "Today's Piano Practice Time"
unit_of_measurement: "mins"
- unique_id: piano.thisweekspracticeduration
state_topic: "viewroad-status/piano/thisWeekPracticeDuration"
name: "This Week's Piano Practice Time"
unit_of_measurement: "mins"
automation:
- id: "1648705777863"
alias: Tag Started Piano Practice is Scanned
description: ""
trigger:
- platform: tag
tag_id: af3f595c-5d41-4bb6-8985-27c70b0e6217
condition: []
action:
- service: mqtt.publish
data:
topic: viewroad-commands/chores/piano_practice
payload: start
mode: single
- id: "Tag Finished Piano Practice is Scanned"
alias: Tag Finished Piano Practice is Scanned
description: ""
trigger:
- platform: tag
tag_id: 6e7a6ab5-c7e4-47f3-be8f-830241175d69
condition: []
action:
- service: mqtt.publish
data:
topic: viewroad-commands/chores/piano_practice
payload: end
mode: single

View File

@@ -0,0 +1,25 @@
sensor:
- platform: mqtt_room
device_id: "d75fda56c990"
name: "Nissan Leaf LNM748 (BTB01)"
state_topic: "espresense/rooms"
timeout: 60
away_timeout: 120 # number of seconds after which the enitity will get status not_home
- platform: mqtt_room
device_id: "f54fe90c3d15"
name: "Mazda MPV KUU64 (BTB02)"
state_topic: "espresense/rooms"
timeout: 60
away_timeout: 120 # number of seconds after which the enitity will get status not_home
- platform: mqtt_room
device_id: "c5eba6d8e8fd"
name: "Vespa Scooter B8EJJ (BTB03)"
state_topic: "espresense/rooms"
timeout: 60
away_timeout: 120 # number of seconds after which the enitity will get status not_home
- platform: mqtt_room
device_id: "ed5e450c84a5"
name: "Zephyr Caravan Z556D (BTB04)"
state_topic: "espresense/rooms"
timeout: 60
away_timeout: 120 # number of seconds after which the enitity will get status not_home

2
packages/recorder.yaml Normal file
View File

@@ -0,0 +1,2 @@
# enable the recorder integration (optional)
recorder:

View File

@@ -0,0 +1,69 @@
input_select:
master_bedroom_fan_set:
name: Master Bedroom Fan Speed
initial: "Off"
options:
- "Off"
- "Low"
- "Medium"
- "High"
bedroom_2_fan_set:
name: Bedroom 2 Fan Speed
initial: "Off"
options:
- "Off"
- "Low"
- "Medium"
- "High"
bedroom_3_fan_set:
name: Bedroom 3 Fan Speed
initial: "Off"
options:
- "Off"
- "Low"
- "Medium"
- "High"
automation:
- id: set_the_master_bedroom_fan
initial_state: true
alias: Set the Master Bedroom Fan
trigger:
entity_id: input_select.master_bedroom_fan_set
platform: state
action:
service: mqtt.publish
data:
topic: cmnd/tasmo-ifan02-3793-bedrm1-1/FanSpeed
payload: '{% set mapping = { "Off":"0", "Low":"1",
"Medium":"2", "High":"3" } %} {% set dta = trigger.to_state.state %}
{{ mapping[dta] }}
'
- id: set_bedroom_2_fan
initial_state: true
alias: Set Bedroom 2 Fan Speed
trigger:
entity_id: input_select.bedroom_2_fan_set
platform: state
action:
service: mqtt.publish
data:
topic: cmnd/tasmo-ifan02-7042-bedrm2/FanSpeed
payload: '{% set mapping = { "Off":"0", "Low":"1",
"Medium":"2", "High":"3" } %} {% set dta = trigger.to_state.state %}
{{ mapping[dta] }}
'
- id: set_bedroom_3_fan
initial_state: true
alias: Set Bedroom 3 Fan Speed
trigger:
entity_id: input_select.bedroom_3_fan_set
platform: state
action:
service: mqtt.publish
data:
topic: cmnd/tasmo-ifan02-3497-bedrm3/FanSpeed
payload: '{% set mapping = { "Off":"0", "Low":"1",
"Medium":"2", "High":"3" } %} {% set dta = trigger.to_state.state %}
{{ mapping[dta] }}
'

4
packages/tts.yaml Normal file
View File

@@ -0,0 +1,4 @@
# Text to speech
tts:
platform: google_translate
service_name: google_say

0
scenes.yaml Normal file
View File

0
scripts.yaml Normal file
View File

8
scripts/cctv_detect.yaml Normal file
View File

@@ -0,0 +1,8 @@
#camdetecon:
# alias: booleanopen
# sequence:
# - service: input_boolean.turn_on
# entity_id: input_boolean.cameramotion
# - delay: 00:00:30
# - service: input_boolean.turn_off
# entity_id: input_boolean.cameramotion

View File

@@ -0,0 +1,3 @@
check_config:
sequence: []
alias: Check Configuration

View File

@@ -0,0 +1,6 @@
skip:
alias: skip
sequence:
- service: media_player.media_seek
data_template:
seek_position: "{{ state_attr(media_player.office_tv, 'media_position') | float + 10 }}"

View File

@@ -0,0 +1,7 @@
reload_lounge_browser_lovelace:
sequence:
- service: browser_mod.command
data:
command: lovelace-reload
deviceID:
- lounge_touchscreen

View File

@@ -0,0 +1,23 @@
light_duration:
mode: parallel # Enable parallel executions
description: "Turns on a light for a while, and then turns it off"
fields:
light:
description: "A specific light"
example: "light.bedroom"
duration:
description: "How long the light should be on in minutes"
example: "25"
sequence:
- service: logbook.log
data:
name: "Script Notice.."
message: >
"Light {{ light }} will be turned on for {{ duration }}"
- service: homeassistant.turn_on
data:
entity_id: "{{ light }}"
- delay: "{{ duration }}"
- service: homeassistant.turn_off
data:
entity_id: "{{ light }}"

18
sensor/coronavirus.yaml Normal file
View File

@@ -0,0 +1,18 @@
- platform: statistics
entity_id: sensor.coronavirus_totals_normalised
sampling_size: 200000
state_characteristic: mean
max_age:
days: 1
name: "Coronavirus Statistics"
- platform: template
sensors:
coronavirus_totals_normalised:
friendly_name: "NZ Coronavirus Totals (Normalised)"
value_template: >
{% set new_state = states('sensor.new_zealand_coronavirus_confirmed') | float %}
{% if new_state >= states('input_number.new_zealand_coronavirus_confirmed_previous_value') | float %}
{{ new_state }}
{% else %}
{{ states('input_number.new_zealand_coronavirus_confirmed_previous_value') | float }}
{% endif %}

6
sensor/google_keep.yaml Normal file
View File

@@ -0,0 +1,6 @@
- platform: google_keep
username: !secret google_keep.username
password: !secret google_keep.password
labels:
- "Home Assistant"
pinned: true

26
sensor/grocy.yaml Normal file
View File

@@ -0,0 +1,26 @@
- platform: rest
name: Dog Motel Cleaning
resource: !secret grocy_api_uri_chore3
method: GET
value_template: "{{ (((as_timestamp(value_json.next_estimated_execution_time))-as_timestamp(now())) | int /60/1440) | round(0) }}"
json_attributes:
- last_tracked
- estimated_execution_time
headers:
Accept: application/json
Content-Type: application/json
GROCY-API-KEY: !secret grocy_api_key
unit_of_measurement: "Days"
- platform: rest
name: Red Bin Out
resource: !secret grocy_api_uri_chore2
method: GET
value_template: "{{ (((as_timestamp(value_json.next_estimated_execution_time))-as_timestamp(now())) | int /60/1440) | round(0) }}"
json_attributes:
- last_tracked
- estimated_execution_time
headers:
Accept: application/json
Content-Type: application/json
GROCY-API-KEY: !secret grocy_api_key
unit_of_measurement: "Days"

View File

@@ -0,0 +1,20 @@
- platform: template
sensors:
sensor_internet_downtraffic:
friendly_name: "Internet Download Traffic"
unit_of_measurement: "kB/s"
value_template: "{{ state_attr('binary_sensor.edgeos_interface_pppoe0', 'KBytes/ps (Received)') }}"
- platform: template
sensors:
sensor_internet_uptraffic:
friendly_name: "Internet Upload Traffic"
unit_of_measurement: "kB/s"
value_template: "{{ state_attr('binary_sensor.edgeos_interface_pppoe0', 'KBytes/ps (Sent)') }}"
- platform: template
sensors:
sensor_internet_totaltraffic:
friendly_name: "Internet Total Traffic"
unit_of_measurement: "kB/s"
value_template: "{{ state_attr('binary_sensor.edgeos_interface_pppoe0', 'KBytes/ps (Received)') |float + state_attr('binary_sensor.edgeos_interface_pppoe0', 'KBytes/ps (Sent)') | float }}"

View File

@@ -0,0 +1,19 @@
- platform: template
sensors:
devices_with_low_battery:
friendly_name: "Devices with low battery"
unit_of_measurement: devices
value_template: >-
{{ states.sensor
| selectattr('attributes.device_class', 'eq', 'battery')
| map(attribute='state')
| reject('in', ['unknown', 'unavailable', 'Ok'])
| map('int', -1) | select('le', 97)
| list | count
}}
icon_template: >-
{% if is_state('sensor.devices_with_low_battery', '0') %}
mdi:check-circle
{% else %}
mdi:battery-alert
{% endif %}

View File

@@ -0,0 +1,6 @@
- platform: template
sensors:
electricity_power_total:
friendly_name: "Electricity Power Total"
unit_of_measurement: "W"
value_template: "{{ states('sensor.tasmo_wemosd1_7280_powermon_1_energy_power_0') |float + states('sensor.tasmo_wemosd1_7280_powermon_1_energy_power_1') | float + states('sensor.tasmo_wemosd1_7280_powermon_1_energy_power_2') | float }}"

4
sensor/tautulli.yaml Normal file
View File

@@ -0,0 +1,4 @@
- platform: tautulli
api_key: !secret tautulli_api_key
host: !secret tautulli_api_host
port: !secret tautulli_api_port

6
sensor/tides.yaml Normal file
View File

@@ -0,0 +1,6 @@
- platform: niwa_tides
api_key: !secret niwa_tides_api_key
entity_id: "local_tides"
name: Local Tides
latitude: !secret latitude
longitude: !secret longitude

0
themes.yaml Normal file
View File