updated lovelace dashboards and migrate tcp sensors to use serial component with SOCAT
This commit is contained in:
5
template_sensors/moisture_scale.yaml
Normal file
5
template_sensors/moisture_scale.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
- name: Moisture Scale
|
||||
unique_id: moisture_serial_scale
|
||||
unit_of_measurement: "g"
|
||||
state: >
|
||||
{{ states('sensor.moisture_scale_serial') | float }}
|
||||
25
template_sensors/precision_scale.yaml
Normal file
25
template_sensors/precision_scale.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
- name: Precision Scale Stable
|
||||
unique_id: precision_scale_stable
|
||||
unit_of_measurement: "oz"
|
||||
state: >-
|
||||
{% set value = states("sensor.precision_scale_serial") %}
|
||||
{% 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_stable") | round(4) }}
|
||||
{% endif %}
|
||||
|
||||
- name: Precision Scale
|
||||
unique_id: precision_scale
|
||||
unit_of_measurement: "oz"
|
||||
state: >-
|
||||
{% set value = states("sensor.precision_scale_serial") %}
|
||||
{% 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) }}
|
||||
25
template_sensors/sheller_scale.yaml
Normal file
25
template_sensors/sheller_scale.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
- name: Sheller Scale Stable
|
||||
unique_id: sheller_scale_stable
|
||||
unit_of_measurement: "lb"
|
||||
state: >
|
||||
{% set value = states("sensor.sheller_scale_serial") %}
|
||||
{% 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 %}
|
||||
- name: Sheller Scale
|
||||
unique_id: sheller_scale
|
||||
unit_of_measurement: "lb"
|
||||
state: >
|
||||
{% set value = states("sensor.sheller_scale_serial") %}
|
||||
{% 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) }}
|
||||
|
||||
Reference in New Issue
Block a user