Check-In iSpindel config for HomeAssistant.

This commit is contained in:
Chris Giacofei 2024-04-29 12:51:17 -04:00
parent 2bd12374fc
commit c98aebc716
2 changed files with 29 additions and 21 deletions

View File

@ -1,22 +1,25 @@
- alias: Set BK Input Value
trigger:
platform: mqtt
topic: "brewery/sensor/boil_kettle"
action:
service: input_select.select_option
alias: Send iSpindel
description: ""
trigger:
- platform: state
entity_id: sensor.ispindel001_gravity,sensor.ispindel002_gravity
condition: []
action:
- service: rest_command.send_ispindel
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') }}"
name: "{{ device_attr(device_id(trigger.entity_id), \"name\") }}"
temp: >-
{% macro sensor(n,s) -%}sensor.{{ device_attr(device_id(n), "name") |
lower }}_{{s}}{%- endmacro %}
{{states(sensor(trigger.entity_id,"temperature"))}}
temp_unit: C
gravity: >-
{% macro sensor(n,s) -%}sensor.{{ device_attr(device_id(n), "name") |
lower }}_{{s}}{%- endmacro %}
{{states(sensor(trigger.entity_id,"gravity"))}}
gravity_unit: P
battery: >-
{% macro sensor(n,s) -%}sensor.{{ device_attr(device_id(n), "name") |
lower }}_{{s}}{%- endmacro %}
{{states(sensor(trigger.entity_id,"battery_voltage"))}}
mode: single

View File

@ -0,0 +1,5 @@
send_ispindel:
url: !secret BrewfatherEndpoint
method: POST
content_type: "application/json"
payload: '{ "name":"{{ name }}", "temp":{{ temp }}, "temp_unit":"F", "gravity":{{ gravity }}, "gravity_unit": "P", "battery": {{ battery }} }'