From 6c6fe7a7909c5855aff8f712b857b609157ea500 Mon Sep 17 00:00:00 2001 From: KemoNine Date: Sun, 5 May 2019 18:51:31 +0000 Subject: [PATCH] Updates for initial z-wave setup ; updated dashboards for zwave / sensors ; updated config so z-wave + arduino work together --- .gitignore | 1 + appdaemon/dashboards/Attic.dash | 0 appdaemon/dashboards/Desk.dash | 41 +---------------------- appdaemon/dashboards/Main.dash | 9 +++-- appdaemon/dashboards/Sensors.dash | 46 ++++++++++++++++++++++++++ appdaemon/dashboards/sensors_desk.yaml | 40 ++++++++++++++++++++++ configuration.yaml | 6 ++-- docs/zwave.md | 19 +++++++++++ secrets-example.yaml | 3 ++ sensors/spark_fun_weather_station.yaml | 2 +- 10 files changed, 121 insertions(+), 46 deletions(-) create mode 100644 appdaemon/dashboards/Attic.dash create mode 100644 appdaemon/dashboards/Sensors.dash create mode 100644 appdaemon/dashboards/sensors_desk.yaml create mode 100644 docs/zwave.md diff --git a/.gitignore b/.gitignore index 02db6e3..a8e4096 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ ip_bans.yaml known_devices.yaml secrets.yaml ToDo.md +OZW_Log.txt !.github !.gitignore diff --git a/appdaemon/dashboards/Attic.dash b/appdaemon/dashboards/Attic.dash new file mode 100644 index 0000000..e69de29 diff --git a/appdaemon/dashboards/Desk.dash b/appdaemon/dashboards/Desk.dash index 0c239e3..5999537 100644 --- a/appdaemon/dashboards/Desk.dash +++ b/appdaemon/dashboards/Desk.dash @@ -17,51 +17,12 @@ nav_back: icon_inactive: mdi-arrow-left-bold-outline widget_style: "background: MEDIUMSLATEBLUE;" -temp: - widget_type: sensor - title: "Temperature" - entity: sensor.sparkfun_weather_station_temp_f - sub_entity: sensor.sparkfun_weather_station_temp_c - units: '°F' - -heat_index: - widget_type: sensor - title: "Heat Index" - entity: sensor.sparkfun_weather_station_hi_f - sub_entity: sensor.sparkfun_weather_station_hi_c - units: '°F' - -humidity: - widget_type: gauge - title: "Humidity" - entity: sensor.sparkfun_weather_station_humidity_percent - units: "%" - min: 0 - max: 100 - -pressure: - widget_type: sensor - title: Pressure - entity: sensor.sparkfun_weather_station_pressure_pa - units: 'Pa' - -light: - widget_type: gauge - entity: sensor.sparkfun_weather_station_light_lvl_v - min: 0 - max: 10 - units: "V" - -light_value: - widget_type: sensor - title: Light Level - entity: sensor.sparkfun_weather_station_light_lvl_v - units: 'V' # Layout layout: - include: header - nav_main, clock, nav_back, reload + - include: sensors_desk - temp, heat_index, humidity, pressure - light_value, light, spacer(2x1) - include: status diff --git a/appdaemon/dashboards/Main.dash b/appdaemon/dashboards/Main.dash index b68c98d..3eeacd0 100644 --- a/appdaemon/dashboards/Main.dash +++ b/appdaemon/dashboards/Main.dash @@ -10,7 +10,6 @@ global_parameters: precision: 0 use_hass_icon: 1 -# Navigation nav_weather: widget_type: navigate dashboard: Weather @@ -41,6 +40,12 @@ nav_cameras: icon_inactive: mdi-cctv widget_style: "background: MEDIUMSLATEBLUE;" +nav_sensors: + widget_type: navigate + dashboard: Sensors + icon_inactive: mdi-home-automation + widget_style: "background: MEDIUMSLATEBLUE;" + # Widgets current_weather: widget_type: weather @@ -69,7 +74,7 @@ layout: - include: cameras - include: entertainment - nav_main, clock(4x1), reload - - nav_weather, current_weather(2x1), nav_entertainment, nav_desk, nav_status + - nav_weather, current_weather(2x1), nav_sensors, nav_desk, nav_status - bedroom_tv(3x2), living_room_tv(3x2) - - camera_stairs(3x2), camera_living_room(3x2) diff --git a/appdaemon/dashboards/Sensors.dash b/appdaemon/dashboards/Sensors.dash new file mode 100644 index 0000000..80d1d07 --- /dev/null +++ b/appdaemon/dashboards/Sensors.dash @@ -0,0 +1,46 @@ +# Dashboard Config +title: Sensors +widget_dimensions: [120, 120] +widget_size: [1, 1] +widget_margins: [5, 5] +columns: 6 +rows: 3 +global_parameters: + use_comma: 0 + precision: 2 + use_hass_icon: 1 + shorten: 1 + +nav_back: + widget_type: navigate + dashboard: Main + icon_inactive: mdi-arrow-left-bold-outline + widget_style: "background: MEDIUMSLATEBLUE;" + +label_desk: + widget_type: label + text: Desk + widget_style: "background: MEDIUMSLATEBLUE;" + +label_system_status: + widget_type: label + text: System + widget_style: "background: MEDIUMSLATEBLUE;" + +label_attic: + widget_type: label + text: Attic + widget_style: "background: MEDIUMSLATEBLUE;" + +# Layout +layout: + - include: header + - nav_main, clock(3x1), nav_back, reload + - label_desk(6x1) + - include: sensors_desk + - temp, heat_index, light_value, light, humidity, pressure + - label_attic(6x1) + - label_system_status(6x1) + - include: status + - battery_status, battery_capacity, battery_voltage, battery_current, battery_health(2x1) + - ac_status, ac_current, ac_voltage, spacer(3x1) \ No newline at end of file diff --git a/appdaemon/dashboards/sensors_desk.yaml b/appdaemon/dashboards/sensors_desk.yaml new file mode 100644 index 0000000..49af030 --- /dev/null +++ b/appdaemon/dashboards/sensors_desk.yaml @@ -0,0 +1,40 @@ +temp: + widget_type: sensor + title: "Temperature" + entity: sensor.sparkfun_weather_station_temp_f + sub_entity: sensor.sparkfun_weather_station_temp_c + units: '°F' + +heat_index: + widget_type: sensor + title: "Heat Index" + entity: sensor.sparkfun_weather_station_hi_f + sub_entity: sensor.sparkfun_weather_station_hi_c + units: '°F' + +humidity: + widget_type: gauge + title: "Humidity" + entity: sensor.sparkfun_weather_station_humidity_percent + units: "%" + min: 0 + max: 100 + +pressure: + widget_type: sensor + title: Pressure + entity: sensor.sparkfun_weather_station_pressure_pa + units: 'Pa' + +light: + widget_type: gauge + entity: sensor.sparkfun_weather_station_light_lvl_v + min: 0 + max: 10 + units: "V" + +light_value: + widget_type: sensor + title: Light Level + entity: sensor.sparkfun_weather_station_light_lvl_v + units: 'V' diff --git a/configuration.yaml b/configuration.yaml index caae903..8d80495 100644 --- a/configuration.yaml +++ b/configuration.yaml @@ -56,9 +56,9 @@ updater: # https://home-assistant.io/docs/z-wave/adding/ # https://home-assistant.io/docs/z-wave/ # https://home-assistant.io/components/zwave/ -#zwave: -# usb_path: /dev/ttyACM0 -# network_key: !secret zwave_network_key +zwave: + usb_path: /dev/ttyACM0 + network_key: !secret zwave_network_key # Enable the web server diff --git a/docs/zwave.md b/docs/zwave.md new file mode 100644 index 0000000..620a78b --- /dev/null +++ b/docs/zwave.md @@ -0,0 +1,19 @@ +# Z-Wave Notes + +## Aeotec Z-Stick "Disco Lights" + +On/Off details [here](https://www.home-assistant.io/docs/z-wave/device-specific/#aeotec-z-stick) + +## Good Articles / Further Reading + +- [https://drzwave.blog/2017/01/20/seven-habits-of-highly-effective-z-wave-networks-for-consumers/](https://drzwave.blog/2017/01/20/seven-habits-of-highly-effective-z-wave-networks-for-consumers/) + +## Generating a network key + +From [https://www.home-assistant.io/docs/z-wave/adding/](https://www.home-assistant.io/docs/z-wave/adding/) + +``` bash + +cat /dev/urandom | tr -dc '0-9A-F' | fold -w 32 | head -n 1 | sed -e 's/\(..\)/0x\1, /g' -e 's/, $//' + +``` \ No newline at end of file diff --git a/secrets-example.yaml b/secrets-example.yaml index f028eea..80d3361 100644 --- a/secrets-example.yaml +++ b/secrets-example.yaml @@ -15,6 +15,9 @@ recorder_db_url: "postgresql://user:password@SERVER_IP/DB_NAME" # API Keys dark_sky_api_key: YOUR_API_KEY_HERE +# Z-Wave +zwave_network_key: 'big long string (see docs for generation)' + # Media Devices google_casts: - host: 172.16.0.1 diff --git a/sensors/spark_fun_weather_station.yaml b/sensors/spark_fun_weather_station.yaml index 3777096..3272409 100644 --- a/sensors/spark_fun_weather_station.yaml +++ b/sensors/spark_fun_weather_station.yaml @@ -10,7 +10,7 @@ #} - platform: serial - serial_port: /dev/ttyACM0 + serial_port: /dev/ttyACM1 name: sparkfun_weather_station - platform: template