Closed andyzlen closed 6 years ago
Bindings are meant to deliver precise data. If you need only one decimal you can archive it easily by applying a pattern / format on the state of your item linked to a channel.
Thank you @cweitkamp for your quick answer and your reference to the item patterns. I understand the general rule for bindings “Do not change original things values” which should not be touched.
My current OH installation contains many temperature items with “Temperature [%.1f °C]” or “Temperature [%.1f %unit%]” using channels from 4 different bindings. Therefore, I would explain my use case which is behind my proposal: My home is completely “Alexa-enabled”, among others Alexa skill “Netatmo” is activated. But the question ““Alexa, ASK NETATMO what’s the temperature in the children’s room” is approaching a WAF* of ZERO. This is why I tagged the relevant items in OH to allow the more catchy question ““Alexa, what’s the temperature in children’s room”. In this case- you know - the original Netatmo value is directly passed via openhabcloud to Alexa engine and of course ignoring my [%.1f %unit%] item configuration. Then Alexa e.g. tells me (and my wife) “The temperature in the children’s room is twenty-three-point-eight-nine-nine-nine-nine-six-one-eight-five-three-zero-two-seven-three-four-three-seven-five degree”. And – as expected: WAF=0. Then I started to manipulate original Netatmo value in a rule. As the Netatmo binding supports units since OH 2.3 which is a great feature to handle conversions easily but a nasty task if you want to manipulate values in rules – what I wanted to do. At the end – after three hard days of testing I gave up and opened this issue.
Now after five more hours I got a result based on further investigation on the related topics in OH community, see below. Here are several attempts, only first one was successful:
List of references with discussions in community I used for my testing:
*WAF - wife acceptance factor
@andyzlen Thanks for the detailed explanation. I understand your use case and the two resulting issues which are:
I second your opinion that it could be useful and more user-friendly to find a solution for both of them. But none of them is neither an issue of the Netatmo binding, nor of any other binding. On the one hand we could ask for adding this feature in the official Amazon Alexa Skill repository, on the other hand maybe it is even better - because it is a general problem for every TTS service - to ask for adding this feature in the framework (ESH) repository.
@cweitkamp. Thank you for your suggestion which could help also other members of the OH community. For allowing round numeric values to specified precision (number of digits after the decimal point) for TTS services I will open an issue with the proposal to provide a new “Voice” parameter in PaperUI – Configuration-System (org.eclipse.smarthome.voice): “number of digits after the decimal point for TTS services”. Handling of localized numeric values was discussed in another thread “Sending strings to Number-item is not locale independent!”. I would agree with @watou that this would be a great challenge to implement.
Minor issue but hopefully will be considered:
Expected Behavior
Values provided by channel “Temperature” should contain only one digit after decimal point -as accuracy of Netatmo weather stations is ± 0.3°C / ± 0.54°F according to Netatmo technical specs.
Current Behavior
Values from channel “Temperature” contain 18 digits after decimal point, e.g. “19.8999996185302734375 °C”
Your Environment
OpenHab 2.3 (release) binding-netatmo - 2.3.0 Raspbian Jessie