refactor config yaml into new files
This commit is contained in:
18
tcp_sensors/precision_scale.yaml
Normal file
18
tcp_sensors/precision_scale.yaml
Normal 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"
|
||||
Reference in New Issue
Block a user