Announcement

Collapse
No announcement yet.

14 days trigger without using a counter

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

    14 days trigger without using a counter

    Hello,

    I need a way to trigger an event every 2 Saturdays after a certain time, say 7am. The later would be in the conditions.

    And I do not want to use a counter for the days as whenever HS restarts, the counter will be offset and would need to be manually adjusted.

    If anyone has an idea, I'm all ears.

    Running HS 4.1.15, should that matter.



    #2
    Originally posted by zguy View Post
    Hello,
    I need a way to trigger an event every 2 Saturdays after a certain time, say 7am. The later would be in the conditions.
    1st, you cannot trigger on a particular day. That would have to be a condition. See this thread, post #3
    HS4 Pro Edition 4.2.5.0 running on Lenovo ThinkCenter & Debian Linux
    Plugins: Z-Wave (via Nortek USB stick

    Home Assistant 2021.10.6 running on HA "Blue" ODROID-N2
    Add-ons: Android Debug Bridge, Duck DNS, ESPHome, File Editor, Glances, HA Google Drive Backup, InfluxDB, Log Viewer, MariaDB, Mosquitto broker, NGINX SSL Proxy, Node-RED, Portainer, SSH & Web Terminal, Samba, TasmoAdmin, UniFi Controller, Visual Studio Code, WireGuard, Zigbee2mqtt, Z-Wave JS to MQTT
    Integrations: AccuWeather, Alexa Media Player, Glances, Google Nest, HACS, HomeSeer, Insteon, IPP, Life360, Local IP, Logitech Harmony Hub, Mobile App, MQTT, My Garage, OpenWeather, Spotify, Tuya Local. Ubiquiti UniFi, Z-Wave JS
    Insteon: 2413S Dual Band PLM
    Zigbee: zzh! CC2652R Rev A
    Z-Wave: RaZberry daughtercard on RPi 1B via ser2net

    Comment


      #3
      Click image for larger version

Name:	Untitled.png
Views:	205
Size:	191.0 KB
ID:	1476764
      Originally posted by zguy View Post
      Hello,

      I need a way to trigger an event every 2 Saturdays after a certain time, say 7am. The later would be in the conditions.

      And I do not want to use a counter for the days as whenever HS restarts, the counter will be offset and would need to be manually adjusted.

      If anyone has an idea, I'm all ears.

      Running HS 4.1.15, should that matter.

      For some reason I thought this would be a very simple condition but when I went to actually set it up I couldn't believe it wasn't a easy solution. However, I think this event should accomplish what you are wanting to do. Your trigger will need to be a specific time or device trigger:
      HS4 4.2.6.0 &HSTouch Designer 3.0.80
      Plugin's:
      BLBackup, BLOccupied, BLShutdown, EasyTrigger, Ecobee, Nest, AK Bond
      EnvisaLink DSC, PHLocation, Pushover, SONOS, Blue Iris, UltraRachio3,
      weatherXML, Jon00 Alexa Helper, Network Monitor, MyQ, Z-Wave

      Comment


        #4
        How about IF the time is 7:00 AM AND IF the Day is Saturday AND IF the Date is an Even day of the year (Or Odd if that works better for you). You might need to change from Even to Odd once the new year begins.

        Comment


          #5
          Originally posted by Kevb View Post
          How about IF the time is 7:00 AM AND IF the Day is Saturday AND IF the Date is an Even day of the year (Or Odd if that works better for you). You might need to change from Even to Odd once the new year begins.
          I looked at that as well but the date isn't always an EVEN or ODD day every two weeks so there would be some gaps.
          HS4 4.2.6.0 &HSTouch Designer 3.0.80
          Plugin's:
          BLBackup, BLOccupied, BLShutdown, EasyTrigger, Ecobee, Nest, AK Bond
          EnvisaLink DSC, PHLocation, Pushover, SONOS, Blue Iris, UltraRachio3,
          weatherXML, Jon00 Alexa Helper, Network Monitor, MyQ, Z-Wave

          Comment


            #6
            Just set the event to run every Saturday and set the event option to "cannot re-run for 8 days"

            Comment


              #7
              Originally posted by The Profit View Post

              I looked at that as well but the date isn't always an EVEN or ODD day every two weeks so there would be some gaps.
              I think it would work since it's even or odd "day of the year", not whether it's even or odd, i.e. June 5 is the 156th day of the year. But mterry63 has a very good idea

              Comment


                #8
                Originally posted by zguy View Post
                Hello,
                And I do not want to use a counter for the days as whenever HS restarts, the counter will be offset and would need to be manually adjusted.
                I'm not sure what you mean by the above. Counters are not reset when HS4 restarts; I just tested this.
                So, using a counter:
                Click image for larger version

Name:	Increment Counter 1 every Saturday.JPG
Views:	189
Size:	16.2 KB
ID:	1476795
                Click image for larger version

Name:	Run every 2nd Sat 7am.JPG
Views:	182
Size:	36.9 KB
ID:	1476798

                Or Kevb 's answer will work.

                Today is day 147 of the year. Tomorrow (Saturday) will be 148 (even); next Saturday will be day 155 (odd).
                Adding an odd number such as "7" to an odd number results in an even number and vice-versa.

                Click image for larger version

Name:	Run this every 2nd Saturday - Alternative.JPG
Views:	169
Size:	32.5 KB
ID:	1476797
                Attached Files
                HS4 Pro Edition 4.2.5.0 running on Lenovo ThinkCenter & Debian Linux
                Plugins: Z-Wave (via Nortek USB stick

                Home Assistant 2021.10.6 running on HA "Blue" ODROID-N2
                Add-ons: Android Debug Bridge, Duck DNS, ESPHome, File Editor, Glances, HA Google Drive Backup, InfluxDB, Log Viewer, MariaDB, Mosquitto broker, NGINX SSL Proxy, Node-RED, Portainer, SSH & Web Terminal, Samba, TasmoAdmin, UniFi Controller, Visual Studio Code, WireGuard, Zigbee2mqtt, Z-Wave JS to MQTT
                Integrations: AccuWeather, Alexa Media Player, Glances, Google Nest, HACS, HomeSeer, Insteon, IPP, Life360, Local IP, Logitech Harmony Hub, Mobile App, MQTT, My Garage, OpenWeather, Spotify, Tuya Local. Ubiquiti UniFi, Z-Wave JS
                Insteon: 2413S Dual Band PLM
                Zigbee: zzh! CC2652R Rev A
                Z-Wave: RaZberry daughtercard on RPi 1B via ser2net

                Comment


                  #9
                  Originally posted by mterry63 View Post
                  Just set the event to run every Saturday and set the event option to "cannot re-run for 8 days"
                  Won't work, per-se. You cannot run an event every Saturday. Trigger has to be a moment in time.
                  So, working off your suggestion...



                  Every 8 days would work but the above event would then try to run Sun 7am (day 8), Mon 7am (day 9) ... Fri 7am (day13) before being allowed to run again on Sat 7am. Not a big deal - I just prefer specifics!​
                  HS4 Pro Edition 4.2.5.0 running on Lenovo ThinkCenter & Debian Linux
                  Plugins: Z-Wave (via Nortek USB stick

                  Home Assistant 2021.10.6 running on HA "Blue" ODROID-N2
                  Add-ons: Android Debug Bridge, Duck DNS, ESPHome, File Editor, Glances, HA Google Drive Backup, InfluxDB, Log Viewer, MariaDB, Mosquitto broker, NGINX SSL Proxy, Node-RED, Portainer, SSH & Web Terminal, Samba, TasmoAdmin, UniFi Controller, Visual Studio Code, WireGuard, Zigbee2mqtt, Z-Wave JS to MQTT
                  Integrations: AccuWeather, Alexa Media Player, Glances, Google Nest, HACS, HomeSeer, Insteon, IPP, Life360, Local IP, Logitech Harmony Hub, Mobile App, MQTT, My Garage, OpenWeather, Spotify, Tuya Local. Ubiquiti UniFi, Z-Wave JS
                  Insteon: 2413S Dual Band PLM
                  Zigbee: zzh! CC2652R Rev A
                  Z-Wave: RaZberry daughtercard on RPi 1B via ser2net

                  Comment


                    #10
                    It's been a very long time since I looked at it, even though I use it in the background every day, but my "Daily Reminders" script has exactly this type of trigger built in, and as I recall can trigger an event as a part of reminder as well. It's in the scripts library.
                    You'd simply set up an unspoken reminder and set it's repeat to "2 Weeks" or "14 days".
                    Real courage is not securing your Wi-Fi network.

                    Comment


                      #11
                      Originally posted by Wadenut View Post
                      It's been a very long time since I looked at it, even though I use it in the background every day, but my "Daily Reminders" script has exactly this type of trigger built in, and as I recall can trigger an event as a part of reminder as well. It's in the scripts library.
                      You'd simply set up an unspoken reminder and set it's repeat to "2 Weeks" or "14 days".
                      Can you point us to where to find this script? I have tried to find it, but cannot. Thanks.
                      "Living with technology means living in a [constant] state of flux." S. Higgenbotham, 2023
                      "Reboot and rejoice!" F. Pishotta, 1989

                      Comment


                        #12
                        Script Library is in the forums. There is a post about the script requesting input and feedback, but here is the direct link to the script Wadenut created.

                        If none of the other options work, you can also Toggle a virtual On/Off Device. An event would run every Saturday and toggle the virtual device. Another event would run when the virtual device changes and becomes On. See How do I create an event which toggle the state of a device? Since you are apparently running EasyTrigger, from that thread, spud replied with:
                        if you want to avoid scripting, have a look at the EasyTrigger plugin, it has an action to toggle a device between several states:
                        http://board.homeseer.com/showthread...34#post1241734
                        Or you can also use Node Red to toggle a device. If you want to go that route and need help with it, reach out.
                        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


                          #13
                          Originally posted by ksum View Post
                          Script Library is in the forums. There is a post about the script requesting input and feedback, but here is the direct link to the script Wadenut created.
                          Like I said, it's been a very long time since I've looked at it. It occurred to me after mentioning it that there is a possibility it may not work with HS4 since it does do some event manipulation (rescheduling). I know it plays well with HS2 and HS3.
                          Real courage is not securing your Wi-Fi network.

                          Comment


                            #14
                            Gee! I didn't expect so many answers in such a short time. Thanks to all.

                            Maybe I should have specified a few more things. Like I'd rather KISS and use native HS functionalities than adding a plugin/script. Also, the idea is to have something to set and forget. So odd/even days wouldn't work and 26 hardcoded dates per year to manually edit every year would be painful let alone reminding to edit them.

                            Wadenut, not sure your script would fill the bill but I have some ideas where it could get useful.

                            dbrunt , I'll recheck that counter state on restart. My statement was based on a old (like HS2 or early HS3) experience where this wouldn't work.

                            Looks like the best solution would be mterry63 idea but using dbrunt 13 days 23 hours modification and using a device trigger to start with (applicable in my scenario). Then, including this event in power recovery as well, it might just do the trick. Yet, I'm worried not having a reference date in this would eventually break it.

                            What I would have preferred is being able to set a 'date' type virtual device with an anchor date that could be incremented by 14 days every time the event is run. Alas, this is not possible and given HS feature requests response, I'll probably reach my 'End of Life' date before it happens. That'd be a powerful addition though... But with all the date formats available, that might not be as easy to do as saying it.

                            For those script oriented, I initially thought of setting a global variable with the anchor date and updating it as the script run and use that global variable date, providing it survives an HS restart. But I haven't found a way to do that so far.



                            Comment


                              #15
                              Originally posted by The Profit View Post
                              Click image for larger version  Name:	Untitled.png Views:	0 Size:	191.0 KB ID:	1476764

                              For some reason I thought this would be a very simple condition but when I went to actually set it up I couldn't believe it wasn't a easy solution. However, I think this event should accomplish what you are wanting to do. Your trigger will need to be a specific time or device trigger:
                              If it runs on the 5th Saturday it will also run on the 1st (1 week later).
                              HS4 Pro, 4.2.19.16 Windows 10 pro, Supermicro LP Xeon

                              Comment

                              Working...
                              X