updated lovelace dashboards and migrate tcp sensors to use serial component with SOCAT
This commit is contained in:
@@ -1,18 +1,13 @@
|
||||
platform: tcp
|
||||
host: 192.168.1.22
|
||||
port: 23
|
||||
payload: ""
|
||||
name: "Moisture Scale"
|
||||
scan_interval:
|
||||
seconds: 1
|
||||
platform: serial
|
||||
serial_port: /dev/ttyS0
|
||||
name: "moisture_scale_serial"
|
||||
value_template: >-
|
||||
{% if value | contains('S') %}
|
||||
{% set temp_value = value | regex_findall_index('\d+(?=, g)') | float %}
|
||||
{% set temp_value = value | regex_findall_index('\d+\.\d+(?= lb)') | float %}
|
||||
{% if value | contains('-') %}
|
||||
{% set temp_value = temp_value * -1 %}
|
||||
{% endif %}
|
||||
{{ temp_value }}
|
||||
{{ ((temp_value * 50 - (0.5 if temp_value > 0 else -0.5)) | int | float / 50) }}
|
||||
{% else %}
|
||||
{{ states("sensor.moisture_scale") }}
|
||||
{{ states("sensor.sheller_scale") }}
|
||||
{% endif %}
|
||||
unit_of_measurement: "g"
|
||||
|
||||
@@ -1,18 +1,9 @@
|
||||
platform: tcp
|
||||
host: 192.168.1.21
|
||||
port: 23
|
||||
payload: ""
|
||||
name: "Precision Scale"
|
||||
scan_interval:
|
||||
seconds: 0.3
|
||||
platform: serial
|
||||
serial_port: /dev/ttyS3
|
||||
name: "precision_scale_serial"
|
||||
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) }}
|
||||
{% if value | length > 1 %}
|
||||
{{ value }}
|
||||
{% else %}
|
||||
{{ states("sensor.precision_scale") | round(4) }}
|
||||
{{ states("sensor.precision_scale_serial") }}
|
||||
{% endif %}
|
||||
unit_of_measurement: "oz"
|
||||
|
||||
@@ -1,18 +1,3 @@
|
||||
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"
|
||||
platform: serial
|
||||
serial_port: /dev/ttyS2
|
||||
name: "sheller_scale_serial"
|
||||
|
||||
Reference in New Issue
Block a user