Announcement

Collapse
No announcement yet.

Save msg.payload to disk and later retrieve for speech

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

    Save msg.payload to disk and later retrieve for speech

    I'm new to Node-Red so please excuse my ignorance. I use the WeatherXML plugin in HS4. I use a script to combine several days of weather forecasts into a text string that can be displayed in HSTouch. The text string is stored as status in a virtual device in HS4.

    When I add that virtual device in NR, it pushes the message payload when the forecast is updated or if I manually inject a sync into the node. If I go directly from the device node to an Alexa speech node, it works but randomly speaks when the forecast is updated.

    I added a file node so that it will save the msg.payload to a file so I can retrieve it later for on-demand speech when I require it. I can save it to a file but when I retrieve the file and send to the Alexa speech node, it does not work and gives errors. Here is my setup. I'd like to know the correct procedure to save the msg.payload and then retrieve it to send to the speech node. I'd appreciate any ideas on this.


    Click image for larger version  Name:	Capture1.JPG Views:	0 Size:	40.8 KB ID:	1484932
    Click image for larger version  Name:	Capture2.JPG Views:	0 Size:	33.5 KB ID:	1484933
    Click image for larger version

Name:	Capture3.JPG
Views:	140
Size:	25.7 KB
ID:	1484936
    Attached Files

    #2
    So, the wx data is inherently perishable. I would not write it to disk. Rather, I would just store it in a context. If you really want the wx data to persist for some reason, store it in the global context, which is written to disk. Otherwise, just use the flow context.

    Also, is the wx payload json? if so, you wont want to simply concatenate it, which would cause problems the first time you try to add the second report to the first.

    Comment


      #3
      Guys, I don't know how this : https://flows.nodered.org/node/node-...alexa-notifyme can be used but you can contact ksum to look at it.

      More about it here : https://www.thomptronics.com/about/notify-me


      Eman.
      TinkerLand : Life's Choices,"No One Size Fits All"

      Comment


        #4
        you dont need an alexa skill. You can TTS right in Node-Red

        Comment


          #5
          Originally posted by Eki View Post
          you dont need an alexa skill. You can TTS right in Node-Red
          I am aware and am able to do that. My issue is saving the most recent weather forecast to disk and retrieving it from disk later on demand. The forecasts are updated every 2-4 hours. This does not involve Alexa other than for the speech node.

          Comment


            #6
            You COULD save the data to a flow or global Context. This is a variable which is available to other nodes and, if global, other flows (tabs).
            Karl S
            HS4Pro on Windows 10
            1070 Devices
            56 Z-Wave Nodes
            104 Events
            HSTouch Clients: 3 Android, 1 iOS
            Google Home: 3 Mini units, 1 Pair Audios, 2 Displays

            Comment


              #7
              Originally posted by ksum View Post
              You COULD save the data to a flow or global Context. This is a variable which is available to other nodes and, if global, other flows (tabs).
              That works nicely. Thanks!

              Comment

              Working...
              X