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