Error every time macro runs

If you have a question or need help, this is the place to be.
Post Reply
trickyrick
Posts: 22
Joined: Mon Jul 16, 2018 4:32 pm

Error every time macro runs

Post by trickyrick » Wed May 29, 2019 9:46 pm

I have EG setup in Smartthings and use a dimmer so as to use different dimmer levels to trigger different things on my Computer. Every Macro works but then I get several lines of errors. I struggle with EG so I don't have any idea what they're for. I have attached a pic of the left side and right side of EG
Thanks
Rick
Attachments
RightSide.jpg
LeftSide.jpg

User avatar
kgschlosser
Site Admin
Posts: 5508
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Error every time macro runs

Post by kgschlosser » Thu May 30, 2019 1:56 am

ok the issue is this. you have a macro that gets run when the st.ST.EventGhostDimmer.level event comes in. that macro has 2 actions. one of the actions triggers the event Main.EgDimmer.{Payload value at index 0}. if you look at the event st.ST.EventGhostDimmer.level at the end of it you will see [u'100'] that is the payload for the event. this payload is a list. we know this because of the []'s. The easiest way to think of a list is to think of it as say a todo list or a grocery list. you would put an item on each line in a list. a python list is basically the same thing. eact list entry would be a line on that todo or grocery list. Except with a python list the first entry would be line 0 (index 0) so when you get an IndexError that means that there is no item at that index.
list items are comma separated. so in [u'100'] I do not see a comma anywhere.

But in the second action you have entered into the action
"It is currently {eg.event.payload[0]} degrees outside and {eg.event.payload[1]}"

you can see there you are trying to access index 0 and 1. There is no index 1 in the payload, only index 0.

hence the IndexError
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 5508
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Error every time macro runs

Post by kgschlosser » Thu May 30, 2019 2:01 am

also as a note if you right click on a tree item and click copy you can paste it into the forum. anyone that is going to help can then copy and paste the code into their tree and see what is going on. It makes it much easier then a screen shot.

The second thing is if you click on a single log entry. then hold down your left shift key and select another log entry. it will select all entries between and including the one that was first clicked and the one that was second. then press ctrl+c to copy that range of log entries. you will then be able to paste them into a forum post.

when pasting anything like a log entry or a copy of a portion of your tree be sure to add [ code ] on the line before the pasted data and [ /code ] on the line after the pasted data. No spaces in either of those lines. this will ensure that the formatting of the data that is being pasted will be in tact.
If you like the work I have been doing then feel free to Image

Post Reply