2 is a crowd for triggers

Thank you for taking the time to submit your bug/issue! Please use the points below as a guide when submitting.

  • Device & model you are using (Ex: Pi 2 Model B or Arduino Uno with W5100 ethernet shield)
    Wemos D1 R2

  • What dashboard are you using? (Web, iOS, Android)
    Both Android and Web

  • Please describe the bug / issue as detailed as possible. Attaching the code and any relevant screenshots would be very helpful!
    Triggers are working fine unless there are two or more triggers with the same “IF”, than nothings happens

It looked like that scheduling with multiple “actions” had the same problems but today, 17/10/2017 17:45 with a final test they were solved, i must have been dreaming;). No, i was not dreaming also scheduling multiple actions are not workling correctly all the time.

Created a simplyfied project with an UNO+W5100, standard sketch no additions, no hardware, added three custom widgets type button:

My observations so far:

Scheduling:

  • A single scheduling (read with only one action) WORKS
  • Multiple actions in 1 schedule WORKS (thought is was faling :face_with_raised_eyebrow: :tired_face:)
  • Multiple schedules at the same time WORKS

Triggers:

  • A single trigger (read the IF is only used once in all triggers) WORKS
    output_tv4Y96
  • Multiple triggers (read the IF is used in more triggers)
    (If multiple triggers are disabled to one it act as a single trigger and WORKS)

At the moment if you edit a trigger it is copied as a new one.
Hope this helps.

@wj4me thanks for the detailed bug report here, this is great information.

We can reproduce on our end:

  • Multiple uses of the same IF statement in triggers causing them all to fail

we can’t reproduce thus far:

  • Multiple actions in one scheduled event causes them all to fail

I know you said the latter worked for you, at least some times, so maybe it is more intermittent than that. I’d be interested if its still reproducing on your end when you have a free moment, and the detail of the event+multiple actions so I can copy it exactly.

@rsiegel OK, think the dreaming part returned a.k.a the system is not consistent; re-tested a few times and it was working as it should be. Maybe a result of poor internet connection? However that is likely not the case, see my speednet results, but you never know…
afbeelding

I set up two Multiple actions in one scheduled event to switch lights

  1. first half hour lights on
  2. second half hour lights off

Here are the actions in pictures:

And here is the link for sharing (btw like this sharing part! good addition! next on the wishlist a copy of the device itself to share :smiley:). Let’s run this for a while and anyone can check; Rangoon and other odd timezones please take care this runs on CET.

1 Like

@wj4me
so you want both led and light to turn on at 10:00 pm and turn off at 10:30?
try a different approach .
add a ON button with virtual pin V1 and OFF button with V2. Now schedule on at 10:00 and off at 10:30.
now read the value of V1 and V2 and depending on the value turn the Led on and off in your programming side.

@shramik_salgaonkar, thanks for your comment, that will work though I am not sure why you need two buttons for the ON and OFF state when one button is sufficient? But either way at that point you need additional logic in your sketch. In my opinion you want to put all (/most of) your logics/controls in your project with tools like scheduling and triggers and remain flexible.

  1. The scheduling of multiple actions seems to be working and my reply to @rsiegel was to create an environment where this could be checked. Why I came to the conclusion this was not working I am now clueless but at this moment we can drop this from the problem list.

  2. Multiple triggers with the same IF is not working at the moment and @rsiegel will hopefully find a solution.

BTW My project is switching lights based upon sunset and sunrise. For this I am using triggers. Putting Lights off in the house are mostly done with scheduling. On a dark day I need to override this manually. At that moment you do not want to have logic in them sketch turning them off again. Why not use luminosity control, good question. My problem the luminosity was too close to the light source and disco was the result :grin:. This project is far from unique but my latest version can be found on Hackster.io. Hopefully at one point in time we can use sunset, sunrise in Cayenne without calculating it ourselves. Wish list!! (Please set time2wait to zero because else it can cause disconnections from the server).

The multiple triggers with same IF statements is just a bug and while it can possibly be worked around with some Rube Goldberg logic, ultimately we’ll try to fix is as soon as possible.

Day/Night functionality has long been on the Cayenne roadmap and is a likely candidate for a new feature once we’ve solved some of these outstanding bugs with the current feature set.

@rsiegel thanks for all the good work and your replies.

BTW just notice that adding a new scheduling shows double:

  1. In month view only
  2. 1st day of the month normaal, other days double

Thanks, this one is a small issue with the way the month view is coded graphically. It doesn’t actually have to do with the 1st day of the month at all, any event scheduled from 23:30 to 23:55 will look duplicated like this (it’s actually not duplicating – no need to worry about your event running twice – it’s just visually bleeding over into the next day due to being so close to midnight. We’ll get it squashed soon.

@rsiegel f.y.i. since a view days a schedule (with 5 actions) did not work anymore, but others just kept on working. Added an identical schedule and this one also works. Tried to change the non-working one without any effect; shorten description, timezone, less actions. A bit puzzled again.

Think the advice is not working delete and start over :slight_smile:

afbeelding

Can I ask if the event which is no longer working has any notifications associated when it fires (SMS or email)? If not, could you add notifications as a test? The reason I ask is that if the notifications come but the actions don’t happen, this usually indicates that the server fired the scheduled event OK, but the device didn’t respond to them. If the notifications don’t come either, it’s more likely that something failed on our end to even request the scheduled actions.

Hi @rsiegel, the good news is that the schedule just run, the bad news is not on the expected time but one hour earlier. See my comments here.

The original problem was in the schedules early eveninng CET were light did not turn on. The other schedules round CET midnight had no problems and lights turned of as expected. None of them have notifications, I will add one to the 17:25 which should run in 20 minutes or so.

It might be this is just a DST problem?

EDIT at 17:31: Though I expected this was the working schedule nothing happened and notifications were not received.

@rsiegel thanks for your answer here. Still a bit confused because one of my schedules (with multiple actions) was working fine till the moment a notification was added to the schedule two day ago. Today I created a new multiple action schedule which run perfectly (the first time) including the notification. Will keep on monitoring

afbeelding

Could it be that the multiple action schedule becomes instable/inactive/disconnected after editing the schedule?
(btw schedule created in web)

f.y.i. if you edit a trigger you end up with two triggers. (at least in the web version)

I want to say thank you again for all of this detail, it’s invaluable for helping to track down sneaky bugs.

I’m not able to reproduce this just yet. I made a schedule to turn on 2 LEDs on an Arduino (not MQTT), with no notifications. It turned them both on OK. Then I edited the schedule to add SMS and email notifications, and advanced the time 5 minutes. They still ran OK, with notifications. Maybe some sort of recurrence is key here? do you mind screenshotting your exact event settings so I can copy them and try to reproduce again?

I know I’ve seen this once, but I could never nail down exactly how it happened. Do you remember what kind of edit you made to the trigger to get it to duplicate? Can you still reproduce on your end? If so, the detail of the original trigger may be useful too.

@rsiegel let’s give me some observations, hope this will be helpfull to improve the environment.

Schedule with multiple actions just run as desired but are “discontinued” after an edit (?). What kind of edits are there? Yes, also I am looking what can be the root case, so here are possible changes and lets test them 1-by-1:

  • change name of schedule → need to check (might be the reason)
  • change time (not date) when to run → tested, still running
  • edit action → tested, still running
  • add action → need to check
  • change (default) time zone → need to check (where can we check the default time zone?)
  • change frequency → need to check
  • change notification → need to check (might be the reason)
  • server flaw → cannot check

Will continue testing. (guess which ones) …(will take some days, what the hell it is weekend)

Bloody easy to create this situation; edit and change the name and end up with two triggers, Both triggers will not work because the system does not allow two triggers with the same “IF”. (done in web environment).

Other observations:

  • Trigger: cannot be delete in Android environment

@rsiegel here is one tracked down sneaky bug (lost my :jeans:)

and the result is TESTED: SCHEDULE NOT RUNNING !!!

@rsiegel small appendix to this observation:

If you change the name and time the schedule keeps on running, even when it failed running the day before because only the name was changed:

Removed (change removed new) from first schedule and result the schedule did not run the next day and start running again successful until description was changed (change text: 23:30 to 23:55 and time from 23:30 to 00:10.

Clueless if the system is consistent with this bug

Groeten van…
:snake:outer-Jan

Thanks once again for all of this detail. Really above and beyond! :slight_smile:

Using these steps I was able to reproduce the issue: changing the name of the recurring event only caused it to stop running. Changing the time will make it work once again. I’ll get this logged so our developers can get to work on squashing it.

Hi @rsiegel, the story continous…

Today a schedule did not run at 23:40 23:45 23:50 CET
It did run for the notification (well received on my cell phone) but not for the actions.
Only seconds later I was able to do the actions manually (so no problem with the connection?)

An early schedule at 17:00 CET had no problem.

Groeten van…
:snake:outer-Jan