Announcement

Collapse
No announcement yet.

Haven't been able to get two events to Trigger

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

    Haven't been able to get two events to Trigger

    Hello,
    I assume I must not have set this event or settings correctly, hoping someone can assist. I have a free charger where I work and have been setting my "Charge Limit" when I get there to 81% and then when I get home I would like it to drop back down to 70%. By doing it this way, I have been saving money on charging. I created two different events below but neither one of them has been triggered as of yet. I'm guessing part of it has to do with the polling interval which is currently set to the default that is set after install, however even after it is polled the event doesn't trigger. For that part, I assume that it doesn't trigger because it doesn't meet all event conditions when it finally triggers because each device updates at different times. Is there a way to get this to work? Is it possible to poll at different rates when the car is driving vs parked?
    Thank you for any help!
    Click image for larger version

Name:	image.png
Views:	109
Size:	27.5 KB
ID:	1613349
    Click image for larger version

Name:	image.png
Views:	82
Size:	23.6 KB
ID:	1613350
    Click image for larger version

Name:	image.png
Views:	84
Size:	23.2 KB
ID:	1613351​​
    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

    #2
    I don't see any reason why those events wouldn't work. Do you see the shift state device updating? Or once you get to work does the car still seem to be in Drive?

    One option is to change the trigger to be based on location instead, since you may enter the geofence and buy yourself some time for the polling to happen.

    When I start rewriting the plugin for HS4, I intend to include the websocket for constant feedback while driving. For now, one option would be to manually implement more frequent polling by creating an event with a recurring trigger every minute with a condition of "car is in drive" that updates the car.

    But again, I think this should work as-is, so I'd like to help you look into why it's not first.

    Comment


      #3
      Originally posted by shill View Post
      I don't see any reason why those events wouldn't work. Do you see the shift state device updating? Or once you get to work does the car still seem to be in Drive?

      One option is to change the trigger to be based on location instead, since you may enter the geofence and buy yourself some time for the polling to happen.

      When I start rewriting the plugin for HS4, I intend to include the websocket for constant feedback while driving. For now, one option would be to manually implement more frequent polling by creating an event with a recurring trigger every minute with a condition of "car is in drive" that updates the car.

      But again, I think this should work as-is, so I'd like to help you look into why it's not first.
      Hi shill thank you for the help!

      Yes, I do see that the shift device updates along with a few other devices but they don't update as it happens in real time, it may take a couple minutes for them to all reflect the actual status. So when I put the car in park, get my stuff out of the trunk and start heading in the office, I'll look at the status and it will show that it is in Drive, 25 mph etc for a couple of minutes, I'll refresh the browser (just to make sure) and at some point several devices will all update. The time the devices show that they update seems to be pretty close to the time I arrive but all devices have the same exact update "time". ( 5/3/2023 4:56:00 PM) I also verified that all devices were showing the correct status in order for the event to trigger. My assumption is that even though all of the triggers/conditions didn't happen all at the same time, because all devices updated at the same exact time, the Trigger and conditions of the event don't match up at the time of the trigger to actually run the event. When I arrived home, I decided just to park and wait 15-20 minutes to see if the event would eventually trigger, but no luck. I'm thinking that if I change the trigger to be based on location instead of shift state, it still won't trigger because when the devices update, they all update at the same exact time.

      I'm thinking that your idea of manually implementing more frequent polling may be my best choice so that some devices will update before others which will allow for the trigger and conditions to line up correctly for the event to run? Completely open to helping track this issue down however you would like to approach it. If I were to set up a manual polling, how would I set this event up?

      IF The event will automatically trigger every 1m, 0s
      AND IF Wake State is Awake (Need this?)
      AND IF Shift State is Drive
      THEN Set Device Status to Update???

      I assume this would affect battery consumption but minimally?
      Not sure if this will matter or not but I'm on the FSD Beta program and am currently on 2022.45.15 (V11.3.6)

      I'm also using the trial version of your PI for testing and planning to purchase, didn't know you were going to update to HS4 but am fulling willing to pay for it twice, you guys put a lot of work into these plugins and I really appreciate it! Makes my life easier everyday!
      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
        [mention]shill [/mention] Hello, Just thought I would check in to see if you might have missed my last post or if you were working/thinking about it in the background? Thanks for any help with this.


        Sent from my iPhone using Tapatalk
        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


          #5
          I'm out of town for the weekend, I'll try to put some thought into this tonight when I get home.

          Comment


            #6
            Originally posted by The Profit View Post

            Hi shill thank you for the help!

            Yes, I do see that the shift device updates along with a few other devices but they don't update as it happens in real time, it may take a couple minutes for them to all reflect the actual status. So when I put the car in park, get my stuff out of the trunk and start heading in the office, I'll look at the status and it will show that it is in Drive, 25 mph etc for a couple of minutes, I'll refresh the browser (just to make sure) and at some point several devices will all update. The time the devices show that they update seems to be pretty close to the time I arrive but all devices have the same exact update "time". ( 5/3/2023 4:56:00 PM) I also verified that all devices were showing the correct status in order for the event to trigger. My assumption is that even though all of the triggers/conditions didn't happen all at the same time, because all devices updated at the same exact time, the Trigger and conditions of the event don't match up at the time of the trigger to actually run the event. When I arrived home, I decided just to park and wait 15-20 minutes to see if the event would eventually trigger, but no luck. I'm thinking that if I change the trigger to be based on location instead of shift state, it still won't trigger because when the devices update, they all update at the same exact time.

            I'm thinking that your idea of manually implementing more frequent polling may be my best choice so that some devices will update before others which will allow for the trigger and conditions to line up correctly for the event to run? Completely open to helping track this issue down however you would like to approach it. If I were to set up a manual polling, how would I set this event up?

            IF The event will automatically trigger every 1m, 0s
            AND IF Wake State is Awake (Need this?)
            AND IF Shift State is Drive
            THEN Set Device Status to Update???

            I assume this would affect battery consumption but minimally?
            Not sure if this will matter or not but I'm on the FSD Beta program and am currently on 2022.45.15 (V11.3.6)

            I'm also using the trial version of your PI for testing and planning to purchase, didn't know you were going to update to HS4 but am fulling willing to pay for it twice, you guys put a lot of work into these plugins and I really appreciate it! Makes my life easier everyday!
            Here's what I would do:

            Event Name: "Update Tesla Every Minute While Driving"
            Code:
            WHEN The event will automatically trigger every 1m, 0s
            THEN
                IF Shift State is not Park
                    THEN Set Device Status to Update
                IF Shift State is Park
                    THEN Run a script or script command (immediate script command) &hs.DisableEvent("Update Tesla Every Minute While Driving")

            Event Name: "Start Polling When Driving"
            Code:
            IF A device changes and becomes Shift State does not equal Park
            THEN Run a script or script command (immediate script command) &hs.EnableEvent("Update Tesla Every Minute While Driving")
            That way you​'re not forcing HS to trigger something every minute (even though the condition will prevent it from performing any Actions, it still costs something to have the trigger fire every 60 seconds) because it enables/disables the frequent polling when it's not driving. And if that's not perfect and it doesn't notice you start to drive for a few minutes (2.5 on average if you have a normal 5 minute poll time), that's probably ok for this scenario.

            If you're ok with the constant trigger (it's not terrible, but they can add up or be problematic on older devices) then a simple version of what you suggested is fine:

            Code:
            IF The event will automatically trigger every 1m, 0s
            AND IF Shift State is Drive
            THEN Set Device Status to Update


            A final option would be to fire off an Update anytime someone's geolocation changes (using "do not allow this event to trigger again for 60 seconds") from known locations which would help cut down the delay on the "Start Polling When Driving" for hopefully 80% of the times the car is moving.

            And yes, this will add some vampiric drain, but compared to driving the car, it's negligible.

            Comment


              #7
              shill
              It's been a little bit since I have followed up on this and wanted to say thank you for the help with this! Your suggestions have been very helpful, I have been using the below events for a little while and they have worked great! I decided that I don't really need the car to be polled while driving, just as I get closer either to work or home. I use Geofency quite a bit for other automations and it's been reliable. So nice when automation makes life a little easier....

              Click image for larger version

Name:	image.png
Views:	48
Size:	18.4 KB
ID:	1626428
              Click image for larger version

Name:	image.png
Views:	38
Size:	24.3 KB
ID:	1626429
              Click image for larger version

Name:	image.png
Views:	42
Size:	55.4 KB
ID:	1626430​​
              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


                #8
                Very cool - thanks for sharing the detailed example of how you implemented that!

                Comment

                Working...
                X