Home Assistant Community

Speech Parser script to extract entity Id information into readable form for Alexa or Google Assistant TTS

#23

Yes thats cool but this way I have to switch it to appdeamon, and for now I want to keep it in ha.

I will probably switch later to your script.

0 Likes

#24

Ok how can i do that? is there a command for that like “round”

0 Likes

#25

easiest way is to integer divide ( double division sybmol ).

{{ 255 // 10 }}
0 Likes

#26

thanks I will try, but the code above from @lonebaggie seems like he doesn’t do that because he rounds… hm

0 Likes

#27

But to get from 1% to the value 2 I don’t devide.
Or from 10 % to 25.
or from y % to x

x = 255/100 * y
x= 2.55 * y

I tried ** in the template but that doesn’t do the same as //.

So how can I cut this with a multiplication?

0 Likes

#28

just gotta reorganize the math. percentages always divide by 100

{{ (255 * 1) // 100 }}
0 Likes

#29

ok thanks.

I pretty sure know that it shows integers in the amazon app but in fact sends floats.
The reason why I think this is it is possible to drag the slider a little bit arround and stay at a certain value.

Is there a way to fill in a number there and not draging the slider?

0 Likes

#30

Quick update:

  1. X% in Alexa app will always be X% no matter how you use the slider (so no floats as I thought before). This is good, as this makes it reliable
  2. It does indeed not round, it truncates.

Works with the suggestions from above ( // ).

Thanks!

0 Likes

#31

Alexa Home only reports 0-100% as BRI. Home Assistant and Node-Red expect 0-255, so translation is necessary.

0 Likes

#32

So, how does this work? As I said, I have only found Alexa Home which is simply returns on, off, or bri. I would love to be able to script Alexa to respond to other commands. Like, “Alexa what is the basement temperature?”, or could it even let me ask “Alexa, where is kim?” and determine it she is at work or driving using Life 360?

0 Likes

#33

the alexa app on android or iphone supports alexa routines

0 Likes

#34

read the title :slight_smile:

0 Likes

#35

So, you aren’t going to tell me?
How do you get an Alexa routine into Home Assistant?

0 Likes

#36

how about reading the first post from this topic?

edit: but nowadays you can also implement the alexa mediaplayer component.

0 Likes

#37

Nowhere did the prior posts mention an Alexa Mediaplayer Component. (I did not realize that there is an Alexa component). We’re obviously talking about two completely different methods of getting an Alexa interface to Home Assistant.

0 Likes

#38

thats right. but at the time this topic was started there was only 1 option.
and just a simple search on the forum brings a lot. (try alexa and you finde the mediaplayer component)

so the answer to your question how to use alexa routines in HA still stands.

  1. read the first post and use that option
  2. find the custom component alexa mediaplayer on the forum and use that option.
0 Likes

#39

@lonebaggie I used your virtual_light template in my configuration.yaml flike so:

light:
  - platform: template
    lights:
      alexa_virtual:
        friendly_name: "Alexa Dummy Light"
        turn_on:
        turn_off: 
        set_level:

It shows up in my entities and has a state of ‘off’. When I ask alexa to discover devices, it doesn’t find it. Am I supposed to expose it in some other way? I’ve exposed emulated hue lights as scripts and the scripts are discovered fine. I’m using the alexa/media_player v0.10.2.

Thanks

0 Likes

#40

See the following

Any issues I will answer on that thread . Keep the help easy to find

0 Likes

#41

I have updated the program with a global search and replace to amend the final parse. This can be used to translate the language of any of the sensors , or simply to refine the final output

0 Likes

Echo Devices (Alexa) as Media Player - Testers Needed
#42

Updated with the notify option in the current version of alexa media player

1 Like