Announcement

Collapse
No announcement yet.

Need help with openweathermap and change node

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

    Need help with openweathermap and change node

    I'm trying to populate a bunch of Homeseer devices with current weather and forecast data using node red open weather map. I managed to get current temp working using a function but I keep reading that I should be able to do this with a change node. essentially openweathermap returns an object with a bunch of data in it so I grab the current temp with var t and wipe out all the other data and generate just what I want to control the device in homeseer.
    I really don't understand how the change node works. I've watched some tutorials but for some reason I just don't get it.
    Is it possible to do this with a change node instead?

    The function I wrote is:
    Code:
    var t = msg.payload.current.temp
    msg.payload = {};
    msg.topic = "update"
    msg.payload.status = t
    msg.payload.value = parseInt(t)
    //msg.payload.value = t
    return msg;
    Click image for larger version

Name:	owm.png
Views:	145
Size:	251.7 KB
ID:	1464567
    https://forums.homeseer.com/forum/de...plifier-plugin

    #2
    This one will be a fun one to watch. Not sure that I 100% known myself hows to do this.

    Let’s start:

    1.) Are you at the stage where you are successfully getting data from the weather source for everything?

    2.) Looks like you have a proof of concept in terms of storing the temperature in HomeSeer. Is that working?

    3.) Have you set up all of the HomeSeer devices yet?
    HomeSeer 2, HomeSeer 3, Allonis myServer, Amazon Alexa Dots, ELK M1G, ISY 994i, HomeKit, BlueIris, and 6 "4k" Cameras using NVR, and integration between all of these systems. Home Automation since 1980.

    Comment


      #3
      Originally posted by Krumpy View Post
      This one will be a fun one to watch. Not sure that I 100% known myself hows to do this.

      Let’s start:

      1.) Are you at the stage where you are successfully getting data from the weather source for everything?

      2.) Looks like you have a proof of concept in terms of storing the temperature in HomeSeer. Is that working?

      3.) Have you set up all of the HomeSeer devices yet?
      1. yes
      2. yes, using a function but I want to use a change node.
      3. My understanding is weather xml is EOL so I uninstalled the plugin but left all the devices that I want to populate using node red, so yes.

      Here is the dashboard it outputs (all the blue bits)

      Click image for larger version

Name:	dashboard.png
Views:	124
Size:	144.3 KB
ID:	1464592
      https://forums.homeseer.com/forum/de...plifier-plugin

      Comment


        #4
        OK, after about an hour of trial and error I think I got it. I was making it way more complicated than it needed to be.
        Here is my change node for todays low temperature and it seams to be working:

        Click image for larger version

Name:	low.png
Views:	104
Size:	25.2 KB
ID:	1464601
        https://forums.homeseer.com/forum/de...plifier-plugin

        Comment


          #5
          Cool and interesting.... Not sure why you don’t care to use the function node. I guess that is what I would use. Not right or wrong, just thought that function node would provide more control as it provided scripting capability for the data translation. But this is definitely cool.
          HomeSeer 2, HomeSeer 3, Allonis myServer, Amazon Alexa Dots, ELK M1G, ISY 994i, HomeKit, BlueIris, and 6 "4k" Cameras using NVR, and integration between all of these systems. Home Automation since 1980.

          Comment


            #6
            Per the authors of the core Node Red, you should avoid the function node and use native nodes when possible. Function nodes cause excess overhead. S The change node was created for the exact use happnatious1 is using it for.
            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
              Per the authors of the core Node Red, you should avoid the function node and use native nodes when possible. Function nodes cause excess overhead. S The change node was created for the exact use happnatious1 is using it for.
              Exactly this. I'm using the free version of open weather map and there is a surprising amount of data provided with each call. Like rain fall amounts by minute, hour and day. It could end up being a lot of nodes so I wanted to be as efficient with system resources as possible.

              I started with the flow found here: https://flows.nodered.org/flow/d7af9...66c58ea4f0655f
              I'm using the portrait version and my hope is to be able to embed the dashboard into HSTouch.
              https://forums.homeseer.com/forum/de...plifier-plugin

              Comment


                #8
                Originally posted by happnatious1 View Post
                I started with the flow found here: https://flows.nodered.org/flow/d7af9...66c58ea4f0655f
                I'm using the portrait version and my hope is to be able to embed the dashboard into HSTouch.
                I am interested in how this works out for you. I added that same flow to a dashboard only to find the Nodes Red dashboards to be too limiting. But embedding this dashboard into HSTouch might be good. I take it you also intend to use the data for other things inside HomeSeer as there is no need to push the data into HomeSeer otherwise. Or I'm misunderstanding and you will save the data into HomeSeer and use it too build the HSTouch screen. I have also pushed the temperatures and humidity into InfluxDB for chatting in Grafana.
                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


                  #9
                  I want the data in homeseer for things like my alarm clock (HSTouch) announces current temp and forecast but also for freeze warnings (pipes), wind warnings (umbrella by pool, cardboard recycling etc) and the like. My current HSTouch weather screens have the weather information built using just homeseer elements however, I can see where it may save time by embedding a dashboard but this may not be possible.
                  https://forums.homeseer.com/forum/de...plifier-plugin

                  Comment

                  Working...
                  X