Tiles not updating as expected

tiles

#1

1) Give a description of the problem
Tiles at staging.webcore.co are not updating when I expect them to.

2) What is the expected behaviour?
I’ve created a proof of concept for a “dashboard” using tiles to indicate doors that are open and closed. These are all doors that should remain closed, so if they are closed the icon is green (and shows a closed door) and when they are open the icon is red (and shows an open door). I can tell from the logs that it is executing as expected.

3) What is happening/not happening?
Even though the logs show everything is working in the piston, the tiles don’t change colors until I click on one of them to execute the code again. Since the logs are showing that webcore detects the change to the contact sensor and executes the code (correctly) immediately, I expected that the tiles would also update at the same time.

4) Post a Green Snapshot of the pistonimage

5) Attach logs after turning logging level to Full
(Note that I have logging set to minimal because I’ve included more helpful (IMO) logging statements directly in the coding.)

2/12/2022, 3:44:36 PM +478ms
+2ms	╔Received event [Test Contact Sensor].contact = open with a delay of 26ms, canQueue: true, calledMyself: false
+89ms	║Device is Basement door
+96ms	║contact is open set to false
+106ms	║index is currently 0
+127ms	║Device name is Basement Door
+135ms	║contact-is-open is false
+153ms	║Piston tile text is closed
+188ms	║index incremented to 1
+210ms	║Device is Freezer
+217ms	║contact is open set to false
+227ms	║index is currently 1
+247ms	║Device name is Freezer
+254ms	║contact-is-open is false
+272ms	║Piston tile text is closed
+306ms	║index incremented to 2
+328ms	║Device is Garage Door Tilt
+335ms	║contact is open set to false
+344ms	║index is currently 2
+365ms	║Device name is Garage Door
+372ms	║contact-is-open is false
+390ms	║Piston tile text is closed
+424ms	║index incremented to 3
+445ms	║Device is Sliding door
+453ms	║contact is open set to false
+462ms	║index is currently 3
+483ms	║Device name is Sliding Door
+490ms	║contact-is-open is false
+508ms	║Piston tile text is closed
+542ms	║index incremented to 4
+562ms	║Device is Test Contact Sensor
+569ms	║contact is open set to true
+579ms	║index is currently 4
+599ms	║Device name is Test Sensor
+607ms	║contact-is-open is true
+625ms	║Piston tile text is open
+659ms	║index incremented to 5
+673ms	╚Event processed successfully (671ms)

#2

It worked for me without any modification to your piston. Maybe you didn’t give the dashboard time to refresh?

Door%20Tile


#3

Thanks for testing it. Any idea how long it took to update for you?


#4

I’ve tested it some more and it’s even stranger than I thought. Not only does it not update as expected, but when it does update (by my clicking on of the tiles to execute the piston manually) that update only refreshes for a couple seconds and then it reverts to the previous status. It became obvious this was happening when the updated times were 8:42 pm but then quickly reverted to the previous time I tested the piston (3:32 pm). It’s almost like the webpage itself is caching information and not updating asynchronously like it’s designed to do.

Might there be a setting in Chrome that I need to change to allow the desired behavior of the web page?


#5

I believe the dashboard is set to refresh every 10 seconds as you can see the delay in that gif I posted. And then there’s me open/closing the virtual contact.

Oh, I did the test on dashboard.webcore.co btw, not the staging* site.


#6

According to this code:

pic

{contact_is_open} will be ‘false’ if the last one checked is closed…
(IE: You can only guarantee seeing ‘true’ if all are open)

Is this intentional?


Pro Tip:

If you want inverted logic, I’d drag your ‘closed’ block before the ‘open’ block. (so ‘true’ becomes default)