Coder Social home page Coder Social logo

Comments (10)

digitaldan avatar digitaldan commented on August 15, 2024 1

We do support specifically German in the app meta information , but this is not something in code, but rather how its deployed and distributed. There is not language specifics in the smart home skill api. I don't think rounding C values is the right answer here, that would affect our UK and other Celsius users. Since German is not suppose to work in this case (not sure how it is), we may need to wait for them to support it properly.

from openhab-alexa.

3DJupp avatar 3DJupp commented on August 15, 2024

I also hear Twentythird degree four instead of twentythree dot four degrees (in German dreiundzwanzigster vier Grad)
This might be an issue caused by Alexa itself.
But maybe it is a thing caused by the decimal point. In software it's often a dot, but in German language it's a comma. Maybe Alexa / Amazon could not parse the dot correctly.
Even temperatures work great.

from openhab-alexa.

mgeramb avatar mgeramb commented on August 15, 2024

I looked now in the source and I see that the number transferred to the alexa api, not a string, so it must be a bug in Alexa software itself.
And I found this hint in the development documentation:

GetTemperatureReadingRequest

Example Utterances: “Alexa, what is the temperature of device name?”
Purpose: Requests the temperature reading of the specified device. Sent from the Smart Home Skill API to the skill adapter. Currently supported in the US and UK.

Maybe because amazon know, that is not correct...

But maybe it is possible to round the number, so that there are no decimal places, at least if the language setting is german. In my opinion the decimal places are not so important for the temperature.

Kind regards,
Michael

from openhab-alexa.

digitaldan avatar digitaldan commented on August 15, 2024

Hi, so I think I'm hearing the issue is that alexa is not pronouncing the temperature request correctly in German with regards to the decimal?

For Celsius values we simply pass whatever value comes from OH to Alexa. Do you know if your OH instance is reporting something that might be giving it issues? Like maybe more than one decimal place ( eg 23.55 ) ? It sounds like an issue on Amazon's side, but I wonder if there is a way to avoid it without rounding the number up or down to a whole.

The expected return value is a Float type, so amazon does expect a number with at least one decimal place.

According to the smarthome docs this should be supported in German
https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/smart-home-skill-api-reference#temperature-control-and-query-messages

GetTemperatureReadingRequest *US and UK
GetTemperatureReadingResponse *US and UK
GetTargetTemperatureRequest *US and UK
GetTargetTemperatureResponse *US and UK
SetTargetTemperatureRequest
SetTargetTemperatureConfirmation
IncrementTargetTemperatureRequest
IncrementTargetTemperatureConfirmation
DecrementTargetTemperatureRequest
DecrementTargetTemperatureConfirmation

*** EDIT ***
I should learn to read my own post better, it says UK and US, not German!!! Hmm, odd that it's even working in German, we may need to wait until it's officially supported.

from openhab-alexa.

mgeramb avatar mgeramb commented on August 15, 2024

Hi, so I think I'm hearing the issue is that alexa is not pronouncing the temperature request correctly in German with regards to the decimal?
Yes, exactly

but I wonder if there is a way to avoid it without rounding the number up or down to a whole.
I aggree with you, I had take a look in your code, the only way seems to be to round the value for german usage - I hope you have the Information in the skill available that german is selected. I have tested the rounding approach already by using a OH rule which rounds the value to a virtual item which receives a rounded value with no decimal places, for this the pronouncing is correct.

from openhab-alexa.

patristein avatar patristein commented on August 15, 2024

Hi,
same problem for me.

I think this is based on wrong format of given value.
Have you tried to transform "23.53" to "23,53"?
Should be possible in rules file but sadly I am not familiar with the syntax.

Could you please give me a hint on how to transform the value?
In my case a value of "23.40000000002" is given so I need to round/cut for two digits after delimiter and set delimiter from dot to comma.

Regards
Patrick

from openhab-alexa.

mgeramb avatar mgeramb commented on August 15, 2024

Hi Patrick,
Transformation will not work, I took a look in the alexa skill API and it takes the number itself, not the formatted value. So the wrong transformation to the string is done in the alexa software itself and can only be changed by amazon.
For myself, I have created a additional number item with no channel binding which will be written by a rule which rounds the number to zero decimal places.

Items (The first one is the sensor itself, the second the rounded which is provided to alexa):

Number Garten_Temperatur
        "Garten[%.1f°C]"
        <temperature>
         { channel="zwave:device:cf867d08:node29:sensor_temperature" }
       
Number Garten_Temperatur_Round
        "Garten[%.0f°C]"
        <temperature>
        [ "CurrentTemperature" ]

Rule:

rule "Calculate Garten_Temperatur_Round"
	when 
		System started or
		Item Garten_Temperatur changed
	then
		postUpdate(Garten_Temperatur_Round, Math::round((Garten_Temperatur.state as DecimalType).floatValue()))	
	end

Regards,
Michael

from openhab-alexa.

patristein avatar patristein commented on August 15, 2024

Hi Michael,

thanks for clarification and code snippets.
I'll try to get your solution running ;)

Regards

from openhab-alexa.

3DJupp avatar 3DJupp commented on August 15, 2024

Seems to be solved now.
Amazon updated the speech engine and german grammar is now correct.
"Es ist neunzehn komma drei Grad"

from openhab-alexa.

mgeramb avatar mgeramb commented on August 15, 2024

Yes! I can confirm it, it works now! Thank you Dom1n1c for your hint!

from openhab-alexa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.