From 18538e2e879bdd826ef48ac1ef137e2e6559d63d Mon Sep 17 00:00:00 2001 From: Chris Giacofei Date: Tue, 11 Jan 2022 09:42:12 -0500 Subject: [PATCH] Move stuff that doesn't belong to Arduino. This is just reference for setting up home assistant later. --- boil_kettle/boil_kettle.ino | 36 ---------------------------------- home_assistant/automation.yaml | 22 +++++++++++++++++++++ home_assistant/sensor.yaml | 6 ++++++ 3 files changed, 28 insertions(+), 36 deletions(-) create mode 100644 home_assistant/automation.yaml create mode 100644 home_assistant/sensor.yaml diff --git a/boil_kettle/boil_kettle.ino b/boil_kettle/boil_kettle.ino index 8ee430f..4af5c5b 100644 --- a/boil_kettle/boil_kettle.ino +++ b/boil_kettle/boil_kettle.ino @@ -1,44 +1,8 @@ -/** Home Assitant Sensor - sensor: - - platform: mqtt - name: "boil_kettle_setpoint" - state_topic: "brewery/sensor/boil_kettle" - unit_of_measurement: {{ value_json.units }} - value_template: "{{ value_json.setpoint }}" -*/ - -/**Home Assistant Automation - - alias: Set BK Input Value - trigger: - platform: mqtt - topic: "brewery/sensor/boil_kettle" - action: - service: input_select.select_option - data: - entity_id: input_select.boil_kettle_pwm - option: "{{ trigger.payload.setpoint }}" - - # This automation script runs when the thermostat mode selector is changed. - # It publishes its value to the same MQTT topic it is also subscribed to. - - alias: Set BK PWM - trigger: - platform: state - entity_id: input_select.boil_kettle_pwm - action: - service: mqtt.publish - data: - topic: "brewery/setpoint/bk" - retain: true - payload: "setpoint: {{ states('input_select.thermostat_mode') }}" - -*/ - #include #include #include #include #include -//#include #include #include #include diff --git a/home_assistant/automation.yaml b/home_assistant/automation.yaml new file mode 100644 index 0000000..7edb77c --- /dev/null +++ b/home_assistant/automation.yaml @@ -0,0 +1,22 @@ +- alias: Set BK Input Value + trigger: + platform: mqtt + topic: "brewery/sensor/boil_kettle" + action: + service: input_select.select_option + data: + entity_id: input_select.boil_kettle_pwm + option: "{{ trigger.payload.setpoint }}" + +# This automation script runs when the thermostat mode selector is changed. +# It publishes its value to the same MQTT topic it is also subscribed to. +- alias: Set BK PWM + trigger: + platform: state + entity_id: input_select.boil_kettle_pwm + action: + service: mqtt.publish + data: + topic: "brewery/setpoint/bk" + retain: true + payload: "setpoint: {{ states('input_select.thermostat_mode') }}" \ No newline at end of file diff --git a/home_assistant/sensor.yaml b/home_assistant/sensor.yaml new file mode 100644 index 0000000..dd560b8 --- /dev/null +++ b/home_assistant/sensor.yaml @@ -0,0 +1,6 @@ +sensor: + - platform: mqtt + name: "boil_kettle_setpoint" + state_topic: "brewery/sensor/boil_kettle" + unit_of_measurement: {{ value_json.units }} + value_template: "{{ value_json.setpoint }}" \ No newline at end of file