Home Assistant Alexa 02a: How to make TTS and Announcements Better - Using Node Red

Sdílet
Vložit
  • čas přidán 7. 09. 2024
  • Get your Text to Speech Game on, this time with Alexa and Node Red. I'll show you how to extend the Voice Announcements and TTS capabilities of Home Assistant using NodeRed.
    🎬 THE LINKS - Files / Help / Support:
    - 🛒 Other files & Merch: store.3ative.com
    - 💎 3ATIVE DISCORD: / discord
    - ☕ Buy me a Coffee: www.buymeacoff...
    - 💕 PATREON: / 3ative
    - 💯 Get the Gadgets, Devices and Tools I use: Amazon UK: amzn.to/3uRw8fi
    * As an Amazon Associate I earn from qualifying purchases. Using this link ⇈ provides small monetary support for my channel at no extra cost to you.💖
    #homeassistant #alexa #tts
    My GitHub page for the code I used in the Function Nodes: github.com/3at...
    ~-~~-~~~-~~-~
    Check out: "IKEA Air Quality Sensor: 7-in-1 ESPHome Update Hack"
    • Hack the IKEA Air Qual...
    ~-~~-~~~-~~-~

Komentáře • 120

  • @3ATIVE
    @3ATIVE  Před 4 lety +2

    I've also uploaded another video showing my full setup and a walk-through. It may give you a few ideas:
    czcams.com/video/gNrvq3Lg02A/video.html

    • @3ATIVE
      @3ATIVE  Před 4 lety +1

      I hope it will explain a bit more and show what sort of things can be done.

  • @MrEmccyclone
    @MrEmccyclone Před 4 lety

    That node red flow is going to come in real handy, Thanks so much for sharing.

    • @3ATIVE
      @3ATIVE  Před 4 lety +1

      My pleasure fella, So glad you liked it. 👍

  • @kennethfribert6074
    @kennethfribert6074 Před 4 lety +1

    Wow, this is really great, I actually came here to find out how I could 'tts' a payload, and that part was left out, but I found out. The other thing with the random sentences are REALLY cool, I hope my wife will like the messages it will produce for here :-)

    • @3ATIVE
      @3ATIVE  Před 4 lety

      LOL - I hope she doesn't get too upset. Thank you for your feedback... Have fun!!!

  • @adrianjoss1
    @adrianjoss1 Před 2 lety

    Thank you so much, this is the clearest and most understandable tutorial on the subject.

    • @3ATIVE
      @3ATIVE  Před 2 lety

      Thank you Adrian, it's great to hear my li'tutorial is useful.
      Have fun. 😎

  • @DrZzs
    @DrZzs Před 4 lety +3

    Fantastic! make more! :)

    • @3ATIVE
      @3ATIVE  Před 4 lety +1

      Wow, high praise indeed from my mentor.
      Thank you DrZzzs. Xx

  • @hamhumtube
    @hamhumtube Před 3 lety

    Thanks. Very unique, great work.. Little bit advanced for me but I just managed to implement this project on my setup.

    • @3ATIVE
      @3ATIVE  Před 3 lety

      Thank you for the comment - I'm sure you'll get the hang of it with practice. 👍

  • @lucafelix
    @lucafelix Před 4 lety

    Very helpful, thank you so much for supporting us with nodered! Cheers!

    • @3ATIVE
      @3ATIVE  Před 4 lety

      Happy to help, loads more to come, stay tuned. LOL

  • @JasonWho
    @JasonWho Před 4 lety

    Well done, short and sweet but very powerful

    • @3ATIVE
      @3ATIVE  Před 4 lety

      I find it best to keep to just the facts. LOL

  • @8dsound131
    @8dsound131 Před 3 lety

    Thnak you, that hired me a lot

    • @3ATIVE
      @3ATIVE  Před 3 lety

      I guess you meant _'helped'_ LOL
      Glad you liked it and found it useful. 👍

  • @alsolo1
    @alsolo1 Před rokem +2

    thats amazing!

    • @3ATIVE
      @3ATIVE  Před rokem

      I know right... having Alexa tell me my curtains are opening in many different ways, is so much fun.
      Be sure to check out the rest of my Alexa playlist for other things you can do: czcams.com/video/r-pwLvCT0Bg/video.html

  • @StePhanMckillen
    @StePhanMckillen Před 4 lety +1

    10 out 10 bro well explain made look easy

    • @3ATIVE
      @3ATIVE  Před 4 lety

      Thanks fella, it's always easy... when you know how LOL

  • @alcidesmarcano
    @alcidesmarcano Před 4 lety

    Awesome... Thanks for another great master class!!!

    • @3ATIVE
      @3ATIVE  Před 4 lety +1

      Excellent, I love the 'Master Class' comment, thnx.

  • @jeucedahn
    @jeucedahn Před 2 lety

    Hi! Thanks for all the good information! Any chance you show the configuración for the call service node?

    • @3ATIVE
      @3ATIVE  Před 2 lety +1

      Yep sure, it's like this:
      Domain = notify
      Service = alexa_media_[YOUR DEVICE NAME]
      Data = {"message":"{{payload}}","data":{"type":"tts"}}

    • @jeucedahn
      @jeucedahn Před 2 lety

      @@3ATIVE Thanks a lot! I just realize that you post it on your GitHub as well, sorry I didn't check all the information before asking.

    • @3ATIVE
      @3ATIVE  Před 2 lety

      @@jeucedahn Oh yeah... I forgot about that. You weren't the first to ask. :)

  • @derekcfoley
    @derekcfoley Před 2 lety

    Great video to show building the payload - but you don't show how you're actually calling the TTS service in the blue node and what settings to use, which there isn't much information online about!

    • @3ATIVE
      @3ATIVE  Před 2 lety

      Thanks. 👍
      Someone didn't watch 'Part One' LOL
      I explained it here: czcams.com/video/r-pwLvCT0Bg/video.html

  • @nappyjim
    @nappyjim Před 10 měsíci

    Has something changed since you made this? When I try, my alexa says shes having trouble accessing the simon says skill right now. It doesnt {{states.sensor.thermostat_t6_air_temperature}} part. If I take that out, she says the other words in the quotes.

    • @3ATIVE
      @3ATIVE  Před 10 měsíci

      Not sure, Mine still works as-is and I'm still using the same (as shown)

  • @reinst43
    @reinst43 Před 4 lety

    Nice, Video you should create more content :) I saw this on the DrZzs 12-hour live stream and I have already implemented it in some of my notification flows.

    • @3ATIVE
      @3ATIVE  Před 4 lety +1

      Thank you, it's so great to hear my little tutorials are useful. I've still got loads of ideas and videos to make... Stay tuned! LOL

  • @AndyShrimpton-GaaTech
    @AndyShrimpton-GaaTech Před 3 lety

    Hi dave are these flow still working? trying the second one with no joy. i have tts working on other flows its just using the VAR in the flow i cant even get the debug node to show anything coming out, which is very straange

    • @3ATIVE
      @3ATIVE  Před 3 lety

      Hi Andy. Yeah, nothing's changed. 'var' is a JSON command to declare a variable - so, I doubt that has been re-written. 😊
      Two things to note:
      * Make sure everything apart from your text is all lower-case
      * Ensure your Function node includes the: return msg
      If you've typed everything as I've shown, there should be no problem.

  • @johnkap3340
    @johnkap3340 Před 4 lety

    Great video, thx a million. Do you mind posting how you set the attributes of a sensor as a variable?

    • @3ATIVE
      @3ATIVE  Před 4 lety

      You are welcome.
      I'm not sure what you are asking - The only data I use from a sensor is its 'state'.
      There are not many sensors that have usable attributes. What type of sensor are you asking about?

    • @johnkap3340
      @johnkap3340 Před 4 lety

      @@3ATIVE Sorry my bad, I misread the syntax and thought you were using the attribute of a sensor. Because to my knowledge there is no direct way to parse the attribute data directly to node red, unless you make a template sensor in HA. Btw if you could share the flow in the discription or github would be cool

  • @armag3d0n2oo5
    @armag3d0n2oo5 Před 4 lety

    Hello 😁.
    For the notify tts on Alexa, we need something installed on home assistant or it's working from the nodered contrib Alexa hub?
    Keep going with these videos! 😎

    • @3ATIVE
      @3ATIVE  Před 4 lety +1

      Yes...It's a 'Custom Component' Check out this page:
      github.com/custom-components/alexa_media_player

  • @roystervi
    @roystervi Před 3 lety

    Hi can you point me to one of your video that I can have the TTS on only on my living room dot vs all the dots in my house?.
    So far I have watch some NR vid and all of my tts is saying on every dot in my house.
    thanks

    • @3ATIVE
      @3ATIVE  Před 3 lety

      This video should show everything you need for that.

    • @roystervi
      @roystervi Před 3 lety +1

      @@3ATIVE thanks I see that now thanks, thanks for the fast reply
      am new to NR as of this weekend

    • @3ATIVE
      @3ATIVE  Před 3 lety

      Another one of my videos would be Alexa 04 - Last called Alexa. In that video where I use: 'target: sensor.last_alexa'... you'll just enter your dot's name.

    • @roystervi
      @roystervi Před 3 lety

      @@3ATIVE Do you have any vid there when you ask Alexa to do something Alexa can give you a choice yes or no?
      example: the garage door is open after 9 pm then Alex can tts and say, the garage is open too late do you want me to close it. and the reply input can be Yes or No?

    • @3ATIVE
      @3ATIVE  Před 3 lety

      I don't have one yet, I'm working on it thou.
      However, DrZzz showed how to do it but, tbh it's quite complicated to setup.

  • @easwaran83
    @easwaran83 Před 4 lety

    Great video. Can you please show the contents of the Alexa TTS call service node? How it takes all these contents as message ?? I left the message as empty or """ alexa gives her own custom message not the data from our function hence the query

    • @easwaran83
      @easwaran83 Před 4 lety +1

      got it its "{{payload}}"

    • @3ATIVE
      @3ATIVE  Před 4 lety +1

      No problem, I've added a JPG to my GitHub page (See Description for the link)

    • @easwaran83
      @easwaran83 Před 4 lety

      @@3ATIVE Thanks

  • @boopeshkumarprabhakaran

    hi same way without doing any math is it possible to add 10 small motivational quotes in msg payload and let alexa randomly choose one and speak on each trigger?

    • @3ATIVE
      @3ATIVE  Před 2 lety +1

      Sure, that is easy. From 02:57 (Part Two) I show how to do random lines. Instead, in your Function Node just make a single array of the quotes you want:
      E.G.:
      var line1 = [
      "Small Motivational quote 1",
      "Small Motivational quote 2",
      "Small Motivational quote 4",
      ......
      "Small Motivational quote 10"
      ]
      msg.payload =
      line1[Math.floor(Math.random() * line1.length)]
      return msg
      Note: don't put a comma at the end of the last item in the array

    • @boopeshkumarprabhakaran
      @boopeshkumarprabhakaran Před 2 lety

      @@3ATIVE thanks and reply was to quick tbh....and just now I figured out watching your other video...❤️
      looking forward for more videos on node red + home assistant

    • @3ATIVE
      @3ATIVE  Před 2 lety +1

      @@boopeshkumarprabhakaran You are most Welcome my Friend, I'm always happy to help - If I'm awake, I'm on a PC somewhere ! LOL.
      YAY, glad you not only fixed it but, watched another of my videos ! 😁

  • @randylust7566
    @randylust7566 Před 4 lety +1

    WHAT NODE ARE YOU USING TO THE ECHO?

    • @3ATIVE
      @3ATIVE  Před 4 lety +1

      CHECK THE GITHUB LINK IN THE DESCRIPTION - 😆

    • @PauloAbreu
      @PauloAbreu Před 3 lety +1

      @@3ATIVE That is what I was looking for! Tks.

    • @3ATIVE
      @3ATIVE  Před 3 lety +1

      @@PauloAbreu Unless it's really quick / simple, I'll always upload code, images, files, etc and link them in my descriptions.

  • @explosiveenterprises1479

    When i attempt this the debug node shows the message just fine and the call service node shows that it triggered the alexa however nothing happens and no notification is sent.

    • @3ATIVE
      @3ATIVE  Před 2 lety

      Have you got Alexa setup in Home Assistant too?
      If not, please check my previous tut: czcams.com/video/r-pwLvCT0Bg/video.html

    • @explosiveenterprises1479
      @explosiveenterprises1479 Před 2 lety

      @@3ATIVE sure do and have a fair amount of call service TTS notifications already working. Just can't get the random to work

    • @explosiveenterprises1479
      @explosiveenterprises1479 Před 2 lety

      @@3ATIVE [
      {
      "id": "f9255d2d85ddc63a",
      "type": "inject",
      "z": "7471f7c6faab5a73",
      "name": "",
      "props": [
      {
      "p": "payload"
      },
      {
      "p": "topic",
      "vt": "str"
      }
      ],
      "repeat": "",
      "crontab": "",
      "once": false,
      "onceDelay": 0.1,
      "topic": "",
      "payload": "",
      "payloadType": "date",
      "x": 200,
      "y": 1280,
      "wires": [
      [
      "ac842e515a259f63"
      ]
      ]
      },
      {
      "id": "ac842e515a259f63",
      "type": "function",
      "z": "7471f7c6faab5a73",
      "name": "Random Made TTS",
      "func": "var line1 = [\"Awesome, \", \"Oh wow, \", \"Excellent, \", \"Super, \"]
      var line2 = [
      \"This bloke \", \"3a tiv \", \"Your mate \", \"That guy \", \"3a tiv \"
      ]
      var line3 = [
      \"has made \",
      \"has only gone and made \",
      \"has got \",
      \"has uploaded \",
      \"Shared \"
      ]
      var line4 = [
      \"an excellent video, \", \"a super tutorial, \", \"another great tutorial, \", \"a great video, \"
      ]
      var line5 = [
      \"tell everyone.\", \"dont forget to hit the like button.\", \"Subscribe.\", \"did you like it?\"
      ]

      msg.payload =

      line1[Math.floor(Math.random() * line1.length)] +
      line2[Math.floor(Math.random() * line2.length)] +
      line3[Math.floor(Math.random() * line3.length)] +
      line4[Math.floor(Math.random() * line4.length)] +
      line5[Math.floor(Math.random() * line5.length)]

      return msg",
      "outputs": 1,
      "noerr": 0,
      "initialize": "",
      "finalize": "",
      "libs": [],
      "x": 390,
      "y": 1280,
      "wires": [
      [
      "04b33268169b8167",
      "6d2ce72057564459"
      ]
      ]
      },
      {
      "id": "04b33268169b8167",
      "type": "api-call-service",
      "z": "7471f7c6faab5a73",
      "name": "Speak Payload",
      "server": "3b5708c28f627eba",
      "version": 5,
      "debugenabled": false,
      "domain": "notify",
      "service": "alexa_media_adam_s_2nd_echo_dot",
      "areaId": [],
      "deviceId": [],
      "entityId": [],
      "data": "{\t \"message\": \"{{payload}}\",\t \"data\": {\t \"type\": \"tts\"\t }\t}",
      "dataType": "jsonata",
      "mergeContext": "",
      "mustacheAltTags": false,
      "outputProperties": [],
      "queue": "none",
      "x": 640,
      "y": 1280,
      "wires": [
      []
      ]
      },
      {
      "id": "6d2ce72057564459",
      "type": "debug",
      "z": "7471f7c6faab5a73",
      "name": "debug 1",
      "active": true,
      "tosidebar": true,
      "console": false,
      "tostatus": false,
      "complete": "false",
      "statusVal": "",
      "statusType": "auto",
      "x": 620,
      "y": 1240,
      "wires": []
      },
      {
      "id": "3b5708c28f627eba",
      "type": "server",
      "name": "Home Assistant - Overkill",
      "version": 4,
      "addon": false,
      "rejectUnauthorizedCerts": true,
      "ha_boolean": "y|yes|true|on|home|open",
      "connectionDelay": true,
      "cacheJson": true,
      "heartbeat": false,
      "heartbeatInterval": "30",
      "areaSelector": "friendlyName",
      "deviceSelector": "friendlyName",
      "entitySelector": "friendlyName",
      "statusSeparator": ": ",
      "statusYear": "hidden",
      "statusMonth": "short",
      "statusDay": "numeric",
      "statusHourCycle": "default",
      "statusTimeFormat": "h:m"
      }
      ]

    • @3ATIVE
      @3ATIVE  Před 2 lety

      @@explosiveenterprises1479 OIC, cool.
      Paste in your function node code and I'll take a look

    • @3ATIVE
      @3ATIVE  Před 2 lety

      @@explosiveenterprises1479 I saw you reply but, when I went to reply it disappeared ! :(
      Try Pasting it in again. Cheers.

  • @stevefromuk
    @stevefromuk Před 3 lety

    Thanks for the video.
    I'm just making my way through your alexa videos now and have my alexa responding fine within node red,
    but i've set this up and copied and pasted your function code and replaced with my sensors with the line in and out etc.
    But when i go to run it alexa says this..
    "hmm i'm having trouble accessing your simon says EU skill right now"
    i've looked for a EU skill but can't find that have you any idea ?
    Cheers

    • @3ATIVE
      @3ATIVE  Před 3 lety

      Hmmm... that's a new one!
      The 'Simon Says' skill is what it uses to repeat a phrase. Maybe the Amazon network has an issue in your area, I just tried it here and it's still working.
      Try this, say to your Alexa: "Alexa, Simon says This is a test". If she repeats back "This is a test" it's something with your setup, maybe the country in your settings, E.G. mine is set for:
      alexa_media:
      accounts:
      ...
      ...
      url: amazon.co.uk

    • @stevefromuk
      @stevefromuk Před 3 lety

      @@3ATIVE
      Thanks for the reply , yeah the simon says works fine when asking alexa and confirmed my url is set to .co.uk.
      I'm wondering wether it's some setting i've messed with in the AWS console.
      i'll look through my settings
      Cheers

    • @Ned798
      @Ned798 Před 2 lety

      @@stevefromuk hey, did you ever fix this? i just tried it and get the same error

  • @laneyweb
    @laneyweb Před 3 lety

    Firstly, thanks again for a helpful NodeRed tutorial. I am using the random TTS and it's working really well. I also have a node red setup to play a few of my mp3 files on alexa devices and that is working well too. However, when I try to use the random functionality with those messages, Alexa reads out the mp3 path message rather than playing the mp3 sound. If I post an export of the nodes that work and do not (via pastebin?), would you mind giving me your advice on what I may be doing wrong please?

    • @3ATIVE
      @3ATIVE  Před 3 lety

      Thanks again Darren, It's good to see another of my li' tutorials was useful for for you.
      I'll be happy to have a look at your NR Flow, I block links in my CZcams comments so, go find me on Disord/Facebook/... I'm '3ATIVE' everywhere. :)

    • @laneyweb
      @laneyweb Před 3 lety

      @@3ATIVE Thank you. I have Discord but I'm not sure of the etiquette for gettign on touch there. Do I find a server we are both part of and then message publicly or do I DM you? Sorry, not a big Discord user and I left FB a long time back :)No worries if it's a pain. I can split out the working service nodes and run via rand node, it's just not as smooth as your function.

    • @3ATIVE
      @3ATIVE  Před 3 lety

      @@laneyweb That's ok... I don't like Discord that much either - It's just a PM platform for me. As such you are free to contacting me: 3ATIVE#8871

    • @jeucedahn
      @jeucedahn Před 2 lety

      Hi, Darren! Sorry to step in. Any way you could show how you manage to play the mp3s through NR?
      I can play directly from HA script but I do not know how to do it in NR
      Thanks in advance!

  • @nigelholland24
    @nigelholland24 Před 4 lety

    Hi blade can you show your input boolean please. As I am still learning them. Thanks

    • @3ATIVE
      @3ATIVE  Před 4 lety

      Hi Nigel. I'm not Blade LOL. I couldn't add your 'Input Boolean' question in this video. It has been answered in my next video tho.

    • @nigelholland24
      @nigelholland24 Před 4 lety

      @@3ATIVE really sorry about wrong name forgive me

    • @3ATIVE
      @3ATIVE  Před 4 lety

      @@nigelholland24 No worries fella. 😎

    • @3ATIVE
      @3ATIVE  Před 4 lety

      The Example video is up, I hope it answers your question:
      czcams.com/video/gNrvq3Lg02A/video.html

  •  Před 3 lety

    Hi There! Awesome content! Keep up! Question! Is there an way to set the target to the last called echo as you did in the previous video? The below code works fine:
    {
    "data": {
    "type": "announce",
    "method": "all"
    },
    "title": "Test TTS"
    "message": "Hi There, I can speak!",
    "target": [
    "media_player.echo_plus"
    ]
    }
    Wondering how to replace the "media_player.echo_plus" to a variable with the content of the "sensor.last_called_echo".

    • @3ATIVE
      @3ATIVE  Před 3 lety

      Thank you, I'm happy to hear it helped.
      It's not clear where you are using that code but, this may help:
      - service: media_player.play_media
      data_template:
      entity_id: "{{ states.sensor.last_alexa.state }}"

    •  Před 3 lety

      @@3ATIVE This code is inside the data of the "call service node". I'm not using the service as "alexa_media_echo_plus". Instead I'm just using service as "alexa_media" and pointing the target echo device in the code and I would like to make it flexible to speak in the last called echo.

    •  Před 3 lety

      I already found the aswer to that in this video at 2:28 czcams.com/video/cLv0CGgoTJ0/video.html&ab_channel=3ATIVEVFXStudio Thanks again for the great work! cheers!

    • @3ATIVE
      @3ATIVE  Před 3 lety

      @ Ah, in that case your line needs to be this:
      "target": [
      "{{ states.sensor.last_called_echo.state }}"
      ]

  • @gileansolomonsz6931
    @gileansolomonsz6931 Před 3 lety

    anyone managed to make this work in Google Nest Mini?

    • @3ATIVE
      @3ATIVE  Před 3 lety

      Once you have Google set up for TTS, this NR should be pretty much the same - as it just uses a 'Call Service' Node.

  • @clintAdventures
    @clintAdventures Před 4 lety

    what are you using though to link alexa to nodered not for alexa speaking but to ASK alexa a question like the temperature and have that trigger the node red flow?

    • @3ATIVE
      @3ATIVE  Před 4 lety

      It's all done in Node-Red and Routines in the Alexa App. I simple create a routine that when I say "Bedroom Temperature" it fires the "Device" node in Node Red.

    • @clintAdventures
      @clintAdventures Před 4 lety

      @@3ATIVE yeah i can do that fine with stuff in home assistant i just cant seem to link nodered up to be able to choose things in node red in a routine....

    • @hamhumtube
      @hamhumtube Před 3 lety

      @@3ATIVE see another dead end for me :( Now I am curious how are your alexap app and nodered interconnected?

    • @3ATIVE
      @3ATIVE  Před 3 lety

      @@hamhumtube Sorry, it's not that clear in the video. In the description, I link to one of my GITHUB pages (for the code) but at the bottom is the setting for a 'Call Service' Node. This is what sends the text to the Alexa device.
      Here's the link again: github.com/3ative/Making-TTS-Better-NodeRed

    • @hamhumtube
      @hamhumtube Před 3 lety

      @@3ATIVE thank you. That node I learnt from your other video. I meant how you create routine in app to trigger nodes.

  • @shinoshikumi3832
    @shinoshikumi3832 Před 3 lety

    so looking to make alexa speak, and you don't even show us what node is your " speak Payload"?

    • @3ATIVE
      @3ATIVE  Před 3 lety

      This is a advanced ("Better") TTS tutorial showing mixing text snippets to randomly form sentences. Therefore, it does not go in to basic detail(s).

    • @3ATIVE
      @3ATIVE  Před 3 lety

      Please see the first video in my Home Assistant Alexa series... where I show the "Speak Payload" node:
      czcams.com/play/PLWRTMby105biP9gE08iGLab1FP6n7_mka.html

  • @SCRAMPLER
    @SCRAMPLER Před 2 lety

    Did anyone get these to work on Google home? I am struggling to get it to speak the sensor value from the msg.payload

    • @3ATIVE
      @3ATIVE  Před 2 lety

      What are you getting? - if anything.

    • @SCRAMPLER
      @SCRAMPLER Před 2 lety

      @@3ATIVE Everything works fine, the message text is spoken, except the conversion of the sensor value is spoken as the text not the correct value. I will copy my example

    • @SCRAMPLER
      @SCRAMPLER Před 2 lety

      "the EV6 charge is {{ states('sensor.mikes_ev6_ev_battery') }}." Google just reads this out as double squiggly brackets even though when I check it as templates it returns correct value and it matches your debug output

    • @3ATIVE
      @3ATIVE  Před 2 lety

      @@SCRAMPLER Try this:
      {{states.sensor.mikes_ev6_ev_battery.state}}

    • @SCRAMPLER
      @SCRAMPLER Před 2 lety

      @@3ATIVE no different I’m afraid

  • @worm-haandled4615
    @worm-haandled4615 Před rokem

    I am folowing your steps and get an error [ Call-service error. invalid template (TemplateSyntaxError: unexpected char '&' at 29) for dictionary value @ data['message']"]
    with the following :
    msg.payload =
    "The temperature is "+
    "{{states ('sensor.downstairs_temperature') }}"+ ", " +
    "The thermostat is " +
    "{{ states('climate.downstairs') }}" + ", " +
    "and that is set to " +
    "{{ states('climate.bedroom_cooling.attributes.temperature') }}"
    return msg
    This is the message that gets kicked over:
    message: "The temperature is {{states ('sensor.downstairs_temperature') }}, The thermostat is {{ states('climate.downstairs') }}, and that is set to {{ states('climate.bedroom_cooling.attributes.temperature') }}"

    • @3ATIVE
      @3ATIVE  Před rokem

      Check your code against what I showed here: czcams.com/video/Ib8RffCYcfo/video.html
      You have have a load of extra ( and ' added that I don't show.
      E.G.
      You first one should be:
      "The temperature is " +
      "{{states.sensor.downstairs_temperature.state}}"

    • @worm-haandled4615
      @worm-haandled4615 Před rokem

      @@3ATIVE Now I get:
      Call-service error. UndefinedError: 'None' has no attribute 'attributes'
      On the following updated function
      msg.payload =
      "The temperature is "+
      "{{states.sensor.downstairs_temperature}}"+ ", " +
      "The thermostat is " +
      "{{states.climate.downstairs}}" + ", " +
      "and that is set to " +
      "{{states.climate.bedroom_cooling.attributes.temperature}}"
      return msg
      In states I get this:
      Entity:
      sensor.downstairs_temperature
      Downstairs Temperature
      State:
      69.2

    • @worm-haandled4615
      @worm-haandled4615 Před rokem

      If I remove all {{ items I get "The temperature is" via voice TTS

    • @3ATIVE
      @3ATIVE  Před rokem

      @@worm-haandled4615 Again, check your code against my reply.

    • @worm-haandled4615
      @worm-haandled4615 Před rokem

      @@3ATIVE I did and I get a worse error after I update that. If I use the call service in developer options and paste it directly it works fine, with how I have the added items. Standard Home assistant instance and up to date. Sorry been busy at work. I really want to do the random sounding array. That is why I am practicing with this part to get it running.