refactor config yaml into new files

This commit is contained in:
root
2025-04-28 15:28:48 -04:00
parent 873064d680
commit c31b8831af
23 changed files with 1106 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
platform: tcp
host: 192.168.1.22
port: 23
payload: ""
name: "Moisture Scale"
scan_interval:
seconds: 1
value_template: >-
{% if value | contains('S') %}
{% set temp_value = value | regex_findall_index('\d+(?=, g)') | float %}
{% if value | contains('-') %}
{% set temp_value = temp_value * -1 %}
{% endif %}
{{ temp_value }}
{% else %}
{{ states("sensor.moisture_scale") }}
{% endif %}
unit_of_measurement: "g"

View File

@@ -0,0 +1,18 @@
platform: tcp
host: 192.168.1.21
port: 23
payload: ""
name: "Precision Scale"
scan_interval:
seconds: 0.3
value_template: >-
{% if not value | contains('M') %}
{% set temp_value = value | regex_findall_index('\d+\.\d+(?=oz)') | float %}
{% if value | contains('-') %}
{% set temp_value = temp_value * -1 %}
{% endif %}
{{ temp_value | round(4) }}
{% else %}
{{ states("sensor.precision_scale") | round(4) }}
{% endif %}
unit_of_measurement: "oz"

View File

@@ -0,0 +1,18 @@
platform: tcp
host: 192.168.1.21
port: 26
payload: ""
name: "Sheller Scale"
scan_interval:
seconds: 0.3
value_template: >-
{% if value | contains('S') %}
{% set temp_value = value | regex_findall_index('\d+\.\d+(?= lb)') | float %}
{% if value | contains('-') %}
{% set temp_value = temp_value * -1 %}
{% endif %}
{{ ((temp_value * 50 - (0.5 if temp_value > 0 else -0.5)) | int | float / 50) }}
{% else %}
{{ states("sensor.sheller_scale") }}
{% endif %}
unit_of_measurement: "lb"

View File

@@ -0,0 +1,17 @@
platform: serial
serial_port: /dev/ttyS1
name: "steinlite"
value_template: >-
{% if value | contains(' ') %}
{% if states("sensor.steinlite") | contains("Unknown") %}
{{ value }}
{% else %}
{% if value | contains('Moisture') %}
{{ value }}
{% else %}
{{ states("sensor.steinlite") + " " + value }}
{% endif %}
{% endif %}
{% else %}
{{ states("sensor.steinlite") }}
{% endif %}