Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve handling of units within HA UI #2607

Merged
merged 1 commit into from
Aug 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading