Announcement

Collapse
No announcement yet.

Run inject node on top of each hour

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

    Run inject node on top of each hour

    The inject Node has no option to inject at top of any hour.

    I have the following flow which is working when I inject:


    However using the get hour function and filter option will not work (intention is to inject at top of each hour). The Get hour and filter nodes are given below:


    Click image for larger version

Name:	image.png
Views:	157
Size:	30.1 KB
ID:	1574111

    Any idea how to get this working?

    ---
    John

    ​​

    #2
    The Inject node will work on the hour if configured as shown below. I also included an export of the node if you want to import it instead.

    There is an issue with the timeliness of the inject at least when Node-RED is installed on a Raspberry Pi. My tests have the inject occurring 8 seconds prior to the set interval and I am running on a R-Pi. I changed the minutes to 5 and it fired off at 2:19:52 and then at 2:24:52. I did make sure I deployed the flow at an odd point (such as 2:17) to make sure the test was correct. I also deployed a couple times at different intervals and the 8 seconds prior to was consistent.

    Import:
    Code:
    [{"id":"3f35d274.99189e","type":"debug","z":"5a245aa1.510164","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":680,"y":1840,"wires":[]},{"id":"4bc4cca2.df47e4","type":"inject","z":"5a245aa1.510164","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"0 0-23 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":480,"y":1880,"wires":[["3f35d274.99189e"]]}]
    Click image for larger version

Name:	image.png
Views:	159
Size:	29.3 KB
ID:	1574131
    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


      #3
      Originally posted by ksum View Post
      The Inject node will work on the hour if configured as shown below. I also included an export of the node if you want to import it instead.

      There is an issue with the timeliness of the inject at least when Node-RED is installed on a Raspberry Pi. My tests have the inject occurring 8 seconds prior to the set interval and I am running on a R-Pi. I changed the minutes to 5 and it fired off at 2:19:52 and then at 2:24:52. I did make sure I deployed the flow at an odd point (such as 2:17) to make sure the test was correct. I also deployed a couple times at different intervals and the 8 seconds prior to was consistent.

      Import:
      Code:
      [{"id":"3f35d274.99189e","type":"debug","z":"5a245aa1.510164","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":680,"y":1840,"wires":[]},{"id":"4bc4cca2.df47e4","type":"inject","z":"5a245aa1.510164","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"0 0-23 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":480,"y":1880,"wires":[["3f35d274.99189e"]]}]
      Click image for larger version

Name:	image.png
Views:	159
Size:	29.3 KB
ID:	1574131
      I deployed it, let's see what will happen. Running Node-RED on an Ubuntu server.

      At least this solution is much simpler as mine in case I will get the required result.

      ---
      John

      Comment


        #4
        Originally posted by ksum View Post
        The Inject node will work on the hour if configured as shown below. I also included an export of the node if you want to import it instead.

        There is an issue with the timeliness of the inject at least when Node-RED is installed on a Raspberry Pi. My tests have the inject occurring 8 seconds prior to the set interval and I am running on a R-Pi. I changed the minutes to 5 and it fired off at 2:19:52 and then at 2:24:52. I did make sure I deployed the flow at an odd point (such as 2:17) to make sure the test was correct. I also deployed a couple times at different intervals and the 8 seconds prior to was consistent.

        Import:
        Code:
        [{"id":"3f35d274.99189e","type":"debug","z":"5a245aa1.510164","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":680,"y":1840,"wires":[]},{"id":"4bc4cca2.df47e4","type":"inject","z":"5a245aa1.510164","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"0 0-23 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":480,"y":1880,"wires":[["3f35d274.99189e"]]}]
        Click image for larger version  Name:	image.png Views:	0 Size:	29.3 KB ID:	1574131
        It is working as expected. It consistently will run at the whole hour (or 1 second after the whole hour). For one reason for the level feature it happened 9 seconds after the whole hour.

        Click image for larger version

Name:	image.png
Views:	132
Size:	50.4 KB
ID:	1574188
        ---
        John

        Comment

        Working...
        X