[RELEASE] Multi Attribute Monitor (Tile Builder Module)

I am seeing this error message:

But I've taken all of the special characters out... even the dash. So I'm not sure what it's seeing.

I think I know what it is. Please try this. Go to line 2038 and replace this:
def specialCharacters = ['\', '[', ']', '(', ')', '{', '}', '*', '+', '?', '|', '^', '$']

with this:
def specialCharacters = ['\', '(', ')', '{', '}', '*', '+', '?', '|', '^', '$']

The first set are all of the special characters but I'm using [] so they should not really be included.
If that's it I'll release a fix this weekend.

It's nothing that you are doing wrong, there is a bug\issue somewhere. I've noticed similar behavior with the Hub Info Driver. There are some similarities between the Hub Info Driver and the Weather Driver in that they both do polling and will update multiple Attributes simultaneously. Tile Builder should get called when each monitored attribute changes.

Question is, what happens when it get 5 separate update requests within milliseconds on one another?

I'm going to do some testing to answer that question.

2 Likes

No. I'm still getting the same error. BTW, had to change '' to '\' to save the code.

I've found another one. I have a tile that is used to show devices that have switched from mains power to battery. I had two ring power extenders that have been working on this tile, and I wanted to add an Ecowittl Air Quality Sensor. The Ecowitt has a batteryOrg value of 6 for mains and 5 for battery. I added keywords to change this. The keywords are not working. Here's the setup:

And here's the result:

And I'm getting the same error on the first two, but nothing on the third:

I've not dug into the logic of the code yet but try this first. If a value converts to an Integer or float I'd recommend using Highlights rather than Keywords.

So the two keyword rules would stay the same and keep a Rules setting of all Keywords as you have already. You would remove the 5 and 6 as keywords.

Add two highlights like this and use 5 and 6 for the two rules.


Set the Ecowitt Rules to "All Thresholds"

That should work.

I figured it out. It's basically a logic error in the code. For now, if you turn on "Also Highlight Device Names" that will take the correct branch and you won't see that error.

I'll have time to fix it and I'll roll out an update tomorrow night to fix this and 2 other bugs I'm aware of. Hopefully it will be nice and stable after that.

I have 3 reported bugs thus far and I have identified the cause and cure for all of them. I also have one error to correct.

I'll send out an update tomorrow night (Sunday CST) to correct all of these.

4 Likes

Yes, that worked! Thanks!

Awesome! I so appreciate your customer service on this app. I really appreciate the app, too!

1 Like

I have released version 1.1.0 of Tile Builder Multi Attribute Monitor. It fixes the following bugs:

  1. Inability to left align column text - Fixed.
  2. Silent errors in creating subscriptions to attributes with camel case. - Fixed
  3. Logic error causing the selection of the "Also Highlight Device Names" to create a false error stating the Item Name had reserved characters when it did not. - Fixed

Adds: One new control in the Publishing area.
image

Because MAM can have multiple subscriptions to multiple events on the same device it can receive a lot of updates within a very short period of time. For example here is the log from updating the Hub Info device with the event timeout period set at 0 (the prior default).
8 updates received resulted in 8 publishing events.

Setting the Event Timeout to 2000 ms and the event log looks like this.


When MAM receives an update it sets a time to publish the new table 2 seconds into the future. If another update comes in during that 2 seconds then the time is reset. Once 2 seconds passes with no updates then the table is published.
8 updates received resulted in a single publishing event.

This has not been an issue with Attribute Monitor where we are only monitoring one attribute per device so a dump of consecutive changes is a less likely effect. That said I will add it into Attribute Monitor on it's next update but the Event Timeout default will likely be 0 (as it currently is).

5 Likes

Thanks for the update! I'm not getting the reserved character error any more.

Unfortunately, I'm still not getting the device names highlighted. Any thoughts on that? All of the highlights are thresholds. This is the only tile I have where this doesn't work. Should I just give up and recreate it?

If that works then yes. Can’t imagine why it doesn’t work on this one particular tile.

Thank you, sir. The recent update has resolved the problem I was having with the several subscriptions to multiple events not displaying.

Appreciate all of your hard work for the fix and the great app!

1 Like

I completely blew the tile away and recreated it, and that didn't make the device name highlighted. So I did some more testing, and I think I found a clue.

The device name highlight works just fine if there are four or fewer thresholds. When the fifth threshold is added, the device name will not highlight.

This is the only tile I have that uses 5 thresholds. Hope this helps!

1 Like

Thanks, that is a big help. I just created a new tile with a couple of items in my testing last night so i didnt hit the threshold.

I'll take another look at it.

Both fixed and improved with the Event Timeout counter described above.

1 Like

I'm having trouble displaying a tile when I add more than 2 thresholds for comparing battery levels. I am building a tile to display battery levels for 10 devices. I'd like the colors to be Green for 100%, light green below 99% , orange below 70%, and red below 50%. The tile displays correctly on the local dashboard, but will not display on the cloud dashboard. When the cloud dashboard is used, the tile data is blank. If I use only 2 thresholds, the tile will display correctly on both the local and cloud dashboard. If I set 3 or more thresholds, the tile is blank on the cloud dash, but visible local dash.

edit: Additionally, very repeatable, if I add a Title to the tile, the tile displays blank on the cloud dashboard.

Here is what I created:

My ranges are different but they work as expected. The important thing to note is that each threshold you add has higher priority then the prior ones.

Notice my tile is 1056 bytes so this is sent to a file on the hub and is displayed on the Dash via an iFrame. In this exampled I used a merged header vs a Title to save space.

If I add a Title it shows like this.

With 10 batteries my guess is your tile is being saved to your File Manager. Have a look there and see if you can find it.
image

Format is TB = Tile Builder
SD? = Storage Device Number (Probably 1)
_XYZ = Where XYZ is the tile number you allocated.

Open up that file and see how it looks. Also check your log for any errors.

1 Like

The tile shows correctly in the File Manager. It also shows correctly when using the local web or hubitat app, with all the correct thresholds and colors. However, when the cloud dashboard is used, the tile is not visible if I add more than 1 threshold. Also, I built a similar battery tile with only 2 thresholds, and it works both locally and on the cloud dashboards. But when I add a Header to the working tile, it will not display on the cloud dashboards. very repeatable, I can drop the thresholds to 1 and it will display, and add a few thresholds and it won't display on the cloud dashboard.

In the image below, 2 similar tiles for batteries. the tile on the left has 2 thresholds (<60 and < 40) and the tile on the right that is blank has an added threshold and not displaying.

The logs show a lot of these entries
getNumberType: myVal: B28 cannot be converted to integer
myVal: B28 cannot be converted to float

What you are running into is the 1,024 byte limit for Dashboards to directly display info.
When you generate a Tile the code looks at the size. If it's under 1,024 then it is stored in the HE database and will be visible from the app anywhere.

When you generate a tile > 1,024 bytes it is stored on the File System of the hub. This is available locally but it's not available via the web. Instead you get a space where the tile would be.

So, if you want to see your tiles via the web you must keep them under 1,024 bytes. The next rev of Attribute Monitor will adopt some of the optimizations from Multi-Attribute Monitor and give you an extra 100-200 bytes per tile in most cases which should help.

Notice when you are creating a tile it shows the size and what features are turned on. This is all to assist you in keeping it under 1,024.

You have the Advanced version so consider this. Your tile shows 10 battery devices. Do you really need to see those that are at 100%?

You have options.

  1. You can limit the list to 5 devices and sort the result lowest number first.
  2. You can add a filter and say only show those batteries less than 60% for example.

Both of these strategies will keep the size under 1,024.

With a limited result set you can also use a graphical option to display battery levels if you so desire.
image
Note the minimal formatting to save space.

You can find instructions on how to do this in the help manual which is linked in the app and the original thread.

I'll reduce the number of log messages in the next version, but they don't indicate a problem.