Comments (5)
Oh, I see, and already found the bug there, this conversion is wrong:
"value_template": "{{ float(value|float) * 3.6 | round(2) }}"
Because in Jinja templating of HA, the order of execution is not guaranteed to be left-to-right, only if you use parentheses around everything before the last filter like this:
"value_template": "{{ (float(value|float) * 3.6) | round(2) }}"
For example, copy this into the template editor of developer tools in HA, and get the same 1.4400000000000002:
{{ float(0.4|float) * 3.6 | round(2) }}
while this results the correct 1.44:
{{ (float(0.4|float) * 3.6) | round(2) }}
Now of course this only affects the lines having round() filter in the linked rtl_433_mqtt_hass.py, like speed conversions from m/s to km/h, calculation rain rate/hour, not the temperature, which is simple {{ value|float }}
- but I have no problem with my RTL 433 temperature values in HA, that might be something else with the problem of booroondookZ.
So thanks, I'll report the issue in that main 433 repo, this might as well be closed.
from rtl_433-hass-addons.
I did, and as the fix is very simple, it was merged at once
from rtl_433-hass-addons.
Yes, even more so with wind-speed:
It's easy to create a rounded template sensor in HA, but it would be much better to handle in RTL 433.
It even could be a global option, as I guess a 2 decimal rounding won't hurt any sensor.
(especially because it is not real sensor-precision, but only the result of BCD conversion)
from rtl_433-hass-addons.
merbanan/rtl_433#1509 discusses this upstream. It's pointed out that different systems consuming the MQTT data may need different precision to parse the float correctly. However, in our case, we know that we're consuming the data in Home Assistant and could make some assumptions.
If we implement rounding, would we do it for all floats, or just specific floats? What if different devices needed different options for rounding?
Perhaps more interesting, what if Home Assistant or some upstream library is parsing the float incorrectly? I'm assuming you've confirmed that the numbers in Home Assistant match the MQTT data?
I'm happy to continue the discussion here for now, but I think this is likely best as an update to the upstream script at https://github.com/merbanan/rtl_433/blob/master/examples/rtl_433_mqtt_hass.py.
from rtl_433-hass-addons.
Please link the issue here when you do.
from rtl_433-hass-addons.
Related Issues (20)
- rtl_433 MQTT Auto Discovery (next) does not start HOT 12
- How can you tell which version of rtl_433 you're actively using? HOT 6
- How to install in HA Core? HOT 4
- 0.4.1 Stopped receiving HOT 66
- Is it possible to Filter devices and add fields to data to InfluxDB ? HOT 3
- Auto Discovery publishes SCMPlus time value, skips the rest such as gas meter consumption. Case sensitive? HOT 3
- Device added by Auto Discovery doesn't persist across reboots. "This entity is no longer being provided by the mqtt integration" HOT 2
- on AmbientWeather-TX8300 report Battery statur from rtl_433 MQTT Auto Discovery (next) HOT 6
- DEVICE_TOPIC_SUFFIX config problem HOT 8
- Enable devices disabled by default in config?
- New repository HOT 2
- New version 0.8.0 not working HOT 5
- rtl_433 MQTT Auto Discovery will not run after update HOT 6
- Support RTL-SDR Blog V4 Dongle HOT 3
- No MQTT topic visible HOT 2
- Latest version says rtl_433: option requires an argument: F
- Getting started HOT 4
- Config for device trigger conflicts with existing device trigger HOT 3
- rtl_433 does not start anymore HOT 4
- No MQTT topics created - No error in logs HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rtl_433-hass-addons.