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