Announcement

Collapse
No announcement yet.

NodeRed and Alexa - node-red-contrib-alexa-remote2

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    NodeRed and Alexa - node-red-contrib-alexa-remote2

    I found these examples of using NodeRed and Alexa helpful.

    https://github.com/586837r/node-red-...er/examples.md

    The SSML example is interesting.

    #2
    I have an SSML structured payload in order to have my Alexa devices do announcements as "whisper".

    Comment


      #3
      The SSML is entertaining and useful. You can combine tags too: https://developer.amazon.com/en-US/d...reference.html

      Comment


        #4
        I am trying this as well. My idea was to have a virtual device in Homeseer connected to Alexa to speak "The House is secure" if this device comes on. It all works with one problem, it speaks on any change to device, on or off. How can I make it only to speak when this device comes on?

        Click image for larger version

Name:	NodeRedTest.png
Views:	1266
Size:	104.3 KB
ID:	1414901

        Comment


          #5
          Originally posted by Marty_B View Post
          I am trying this as well. My idea was to have a virtual device in Homeseer connected to Alexa to speak "The House is secure" if this device comes on. It all works with one problem, it speaks on any change to device, on or off. How can I make it only to speak when this device comes on?

          Click image for larger version

Name:	NodeRedTest.png
Views:	1266
Size:	104.3 KB
ID:	1414901
          Maybe remove the "House Secure Off"

          Comment


            #6
            You could also ditch the virtual device and just use a HS event to send a MQTT message or hit a webhook URL hosted by NR.

            Comment


              #7
              Originally posted by drhtmal View Post

              Maybe remove the "House Secure Off"
              I just added the injection nodes for the example. The TestingHouseSecure node is being turned on and off by homeseer.

              Comment


                #8
                Originally posted by AZweimiller View Post
                You could also ditch the virtual device and just use a HS event to send a MQTT message or hit a webhook URL hosted by NR.
                I need to read up on MQTT. I am not sure what that does. I use that virtual device to fire other events, I just thought it would be a nice trigger for node red.

                Comment


                  #9
                  I was going to suggest you add a function node that tests the output of the TestHouseSecure node. If it is on pass the payload along to the HouseSecure node. If it is off do not pass the payload. Unfortunately this does not seen to work because features do not show up for virtual devices.

                  An ugly hack you might try setting an event to fire when the housesecure virtual devices changes to on and then have that event fire another event which would trigger your Node Red flow.

                  Comment


                    #10
                    Originally posted by drhtmal View Post

                    An ugly hack you might try setting an event to fire when the housesecure virtual devices changes to on and then have that event fire another event which would trigger your Node Red flow.
                    I considered using a function node in node red to evaluate the payload and proceed from there. I will keep reading.

                    I thought the event node was a one way street, meaning I could fire homeseer events from node red but could not trigger a node red flow without the use of a device. I am a rookie at this. I have some experimenting and reading to do.

                    Comment


                      #11
                      I think it can be done with the function node.
                      When playing with this, I had a function node that would evaluate MQTT topics and route messages through different Alexa dots. You need to be able to adjust the topics though.
                      Probably, the right thing to do was to process the payload but the payload processing was above my paygrade

                      Comment


                        #12
                        I think the optimal fix would be to have virtual devices provided the same messages a physical device provides. This needs to be fixed in the next release.

                        Comment


                          #13
                          I was able add a function node then simply put an if statement in the function. Now it works perfectly.

                          if (msg.payload.status=="On")
                          {
                          return msg;
                          }

                          Simple enough.

                          Comment


                            #14
                            Originally posted by Marty_B View Post
                            I was able to simply put an if statement in the function and now it works perfectly...
                            Glad you got it working.

                            I see what I was doing wrong. My assumption the virtual devices do not work correctly was incorrect.

                            Comment


                              #15
                              I am using a switch. I set property to msg.payload.value -- 100, so if the virtual switch turns on, it triggers the alexa routine node (which does the TTS)

                              Attached Files

                              Comment

                              Working...
                              X