Skip to content

Commit

Permalink
Improve HA script with detailed units (#2607)
Browse files Browse the repository at this point in the history
  • Loading branch information
lmilius authored Aug 21, 2023
1 parent 4f15236 commit 70d84d0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions examples/rtl_433_mqtt_hass.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@
"device_type": "sensor",
"object_suffix": "WS",
"config": {
"device_class": "wind_speed",
"name": "Wind Speed",
"unit_of_measurement": "km/h",
"value_template": "{{ value|float }}",
Expand All @@ -275,6 +276,7 @@
"device_type": "sensor",
"object_suffix": "WS",
"config": {
"device_class": "wind_speed",
"name": "Wind Speed",
"unit_of_measurement": "km/h",
"value_template": "{{ value|float }}",
Expand All @@ -286,6 +288,7 @@
"device_type": "sensor",
"object_suffix": "WS",
"config": {
"device_class": "wind_speed",
"name": "Wind Speed",
"unit_of_measurement": "mi/h",
"value_template": "{{ value|float }}",
Expand All @@ -297,6 +300,7 @@
"device_type": "sensor",
"object_suffix": "WS",
"config": {
"device_class": "wind_speed",
"name": "Wind Average",
"unit_of_measurement": "km/h",
"value_template": "{{ (float(value|float) * 3.6) | round(2) }}",
Expand All @@ -308,6 +312,7 @@
"device_type": "sensor",
"object_suffix": "WS",
"config": {
"device_class": "wind_speed",
"name": "Wind Speed",
"unit_of_measurement": "km/h",
"value_template": "{{ float(value|float) * 3.6 }}",
Expand All @@ -319,6 +324,7 @@
"device_type": "sensor",
"object_suffix": "GS",
"config": {
"device_class": "wind_speed",
"name": "Gust Speed",
"unit_of_measurement": "km/h",
"value_template": "{{ value|float }}",
Expand All @@ -330,6 +336,7 @@
"device_type": "sensor",
"object_suffix": "GS",
"config": {
"device_class": "wind_speed",
"name": "Wind max speed",
"unit_of_measurement": "km/h",
"value_template": "{{ value|float }}",
Expand All @@ -341,6 +348,7 @@
"device_type": "sensor",
"object_suffix": "GS",
"config": {
"device_class": "wind_speed",
"name": "Wind max",
"unit_of_measurement": "km/h",
"value_template": "{{ (float(value|float) * 3.6) | round(2) }}",
Expand All @@ -352,6 +360,7 @@
"device_type": "sensor",
"object_suffix": "GS",
"config": {
"device_class": "wind_speed",
"name": "Gust Speed",
"unit_of_measurement": "km/h",
"value_template": "{{ float(value|float) * 3.6 }}",
Expand All @@ -374,6 +383,7 @@
"device_type": "sensor",
"object_suffix": "RT",
"config": {
"device_class": "precipitation",
"name": "Rain Total",
"unit_of_measurement": "mm",
"value_template": "{{ value|float|round(2) }}",
Expand All @@ -385,6 +395,7 @@
"device_type": "sensor",
"object_suffix": "RR",
"config": {
"device_class": "precipitation_intensity",
"name": "Rain Rate",
"unit_of_measurement": "mm/h",
"value_template": "{{ value|float }}",
Expand All @@ -396,6 +407,7 @@
"device_type": "sensor",
"object_suffix": "RT",
"config": {
"device_class": "precipitation",
"name": "Rain Total",
"unit_of_measurement": "mm",
"value_template": "{{ (float(value|float) * 25.4) | round(2) }}",
Expand All @@ -407,6 +419,7 @@
"device_type": "sensor",
"object_suffix": "RR",
"config": {
"device_class": "precipitation_intensity",
"name": "Rain Rate",
"unit_of_measurement": "mm/h",
"value_template": "{{ (float(value|float) * 25.4) | round(2) }}",
Expand Down

0 comments on commit 70d84d0

Please sign in to comment.