From 59b09201188eb1a208fb41ba08b2d0099c6053b9 Mon Sep 17 00:00:00 2001 From: ccostan Date: Sat, 17 Feb 2018 19:58:45 -0500 Subject: [PATCH] Updated #308 Garadget Brightness MQTT control - Moved 90% of garadget stuff into Packages. --- .../Timed_Triggers/startup_notification.yaml | 10 ++ configuration.yaml | 12 --- group/garage.yaml | 13 --- packages/garadget.yaml | 95 +++++++++++++++++++ sensor/garadget.yaml | 47 --------- 5 files changed, 105 insertions(+), 72 deletions(-) delete mode 100755 group/garage.yaml create mode 100755 packages/garadget.yaml delete mode 100755 sensor/garadget.yaml diff --git a/automation/Timed_Triggers/startup_notification.yaml b/automation/Timed_Triggers/startup_notification.yaml index 5c5e2639..ff1f7843 100755 --- a/automation/Timed_Triggers/startup_notification.yaml +++ b/automation/Timed_Triggers/startup_notification.yaml @@ -15,3 +15,13 @@ - service: light.turn_off entity_id: group.hallway_lights + + - service: mqtt.publish + data: + topic: "garadget/Garadget Small/command" + payload: "get-status" + + - service: mqtt.publish + data: + topic: "garadget/Garadget Large/command" + payload: "get-status" diff --git a/configuration.yaml b/configuration.yaml index e19113b9..9da03837 100755 --- a/configuration.yaml +++ b/configuration.yaml @@ -240,18 +240,6 @@ wink: # password: !secret wink_password # local_control: True -cover: - platform: garadget - covers: - !secret large_garage_id: - username: !secret garadget_username - password: !secret garadget_password - name: Large Garage - !secret small_garage_id: - username: !secret garadget_username - password: !secret garadget_password - name: Small Garage - group: !include_dir_merge_named group device_tracker: !include_dir_merge_list device_tracker sensor: !include_dir_merge_list sensor diff --git a/group/garage.yaml b/group/garage.yaml deleted file mode 100755 index f96bacba..00000000 --- a/group/garage.yaml +++ /dev/null @@ -1,13 +0,0 @@ -garage_doors: - name: Garage doors - entities: - - cover.large_garage - - sensor.large_garage_status - - sensor.large_garage_time_in_state - - sensor.large_garage_wifi_signal_strength - - sensor.large_garage_reflection_rate - - cover.small_garage - - sensor.small_garage_status - - sensor.small_garage_time_in_state - - sensor.small_garage_wifi_signal_strength - - sensor.small_garage_reflection_rate \ No newline at end of file diff --git a/packages/garadget.yaml b/packages/garadget.yaml new file mode 100755 index 00000000..d3e8ebb7 --- /dev/null +++ b/packages/garadget.yaml @@ -0,0 +1,95 @@ +#------------------------------------------- +# # @CCOSTAN +# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig +## Garadget_Stuff - [Garadget](http://amzn.to/2jQLpVQ) - Garage Door opener/sensor +#------------------------------------------- + +cover: + platform: garadget + covers: + !secret large_garage_id: + username: !secret garadget_username + password: !secret garadget_password + name: Large Garage + !secret small_garage_id: + username: !secret garadget_username + password: !secret garadget_password + name: Small Garage + +sensor: + - platform: template + sensors: + small_garage_status: + friendly_name: 'State of the door' + value_template: '{{ states.cover.small_garage.state }}' + small_garage_time_in_state: + friendly_name: 'Time Since Change' + value_template: '{{ states.cover.small_garage.attributes["time_in_state"] }}' + small_garage_wifi_signal_strength: + friendly_name: 'WiFi strength' + value_template: '{{ states.cover.small_garage.attributes["wifi_signal_strength"] }}' + unit_of_measurement: 'dB' + small_garage_reflection_rate: + friendly_name: 'Reflection Rate' + value_template: '{{ states.cover.small_garage.attributes["sensor_reflection_rate"] }}' + + - platform: mqtt + name: 'Small Garage Brightness' + state_topic: 'garadget/Garadget Small/status' + unit_of_measurement: '%' + value_template: '{{ value_json.bright }}' + + - platform: template + sensors: + large_garage_status: + friendly_name: 'State of the door' + value_template: '{{ states.cover.large_garage.state }}' + large_garage_time_in_state: + friendly_name: 'Time Since Change' + value_template: '{{ states.cover.large_garage.attributes["time_in_state"] }}' + large_garage_wifi_signal_strength: + friendly_name: 'WiFi strength' + value_template: '{{ states.cover.large_garage.attributes["wifi_signal_strength"] }}' + unit_of_measurement: 'dB' + large_garage_reflection_rate: + friendly_name: 'Reflection Rate' + value_template: '{{ states.cover.large_garage.attributes["sensor_reflection_rate"] }}' + + - platform: mqtt + name: 'Large Garage Brightness' + state_topic: 'garadget/Garadget Large/status' + unit_of_measurement: '%' + value_template: '{{ value_json.bright }}' + +group: + garage_doors: + name: Garage doors + entities: + - cover.large_garage + - sensor.large_garage_status + - sensor.large_garage_time_in_state + - sensor.large_garage_wifi_signal_strength + - sensor.large_garage_reflection_rate + - sensor.large_garage_brightness + - cover.small_garage + - sensor.small_garage_status + - sensor.small_garage_time_in_state + - sensor.small_garage_wifi_signal_strength + - sensor.small_garage_reflection_rate + - sensor.small_garage_brightness + +automation: + - alias: 'Update Garage Brightness' + trigger: + - platform: time + minutes: '/2' + seconds: 00 + action: + - service: mqtt.publish + data: + topic: "garadget/Garadget Small/command" + payload: "get-status" + - service: mqtt.publish + data: + topic: "garadget/Garadget Large/command" + payload: "get-status" diff --git a/sensor/garadget.yaml b/sensor/garadget.yaml deleted file mode 100755 index ae7aa3ec..00000000 --- a/sensor/garadget.yaml +++ /dev/null @@ -1,47 +0,0 @@ -################################### -## Garadget_Stuff - [Garadget](http://amzn.to/2jQLpVQ) - Garage Door opener/sensor -################################### - -- platform: template - sensors: - small_garage_status: - friendly_name: 'State of the door' - value_template: '{{ states.cover.small_garage.state }}' - small_garage_time_in_state: - friendly_name: 'Time Since Change' - value_template: '{{ states.cover.small_garage.attributes["time_in_state"] }}' - small_garage_wifi_signal_strength: - friendly_name: 'WiFi strength' - value_template: '{{ states.cover.small_garage.attributes["wifi_signal_strength"] }}' - unit_of_measurement: 'dB' - small_garage_reflection_rate: - friendly_name: 'Reflection Rate' - value_template: '{{ states.cover.small_garage.attributes["sensor_reflection_rate"] }}' - -- platform: mqtt - name: 'Small Garage Brightness' - state_topic: 'garadget/GSmall/status' - unit_of_measurement: '%' - value_template: '{{ value_json.bright }}' - -- platform: mqtt - name: 'Large Garage Brightness' - state_topic: 'garadget/GLarge/status' - unit_of_measurement: '%' - value_template: '{{ value_json.bright }}' - -- platform: template - sensors: - large_garage_status: - friendly_name: 'State of the door' - value_template: '{{ states.cover.large_garage.state }}' - large_garage_time_in_state: - friendly_name: 'Time Since Change' - value_template: '{{ states.cover.large_garage.attributes["time_in_state"] }}' - large_garage_wifi_signal_strength: - friendly_name: 'WiFi strength' - value_template: '{{ states.cover.large_garage.attributes["wifi_signal_strength"] }}' - unit_of_measurement: 'dB' - large_garage_reflection_rate: - friendly_name: 'Reflection Rate' - value_template: '{{ states.cover.large_garage.attributes["sensor_reflection_rate"] }}'