Hi all,
I am trying to be a little fancier recently and using the visibility parameter to provide more information to the user when a switch is OFF
Here is the sitemap entry that I am struggling with
Text item=HO_NodeRed_IP_Online icon=network label="Node Red Online" visibility=[HO_NodeRed_IP_Online==ON]
Text item=HO_NodeRed_IP_LastSeen icon=network label="Node Red Last Seen [%1$ta %1$tR]" visibility=[HO_NodeRed_IP_Online==OFF]
I get this error in my log
2019-07-19 16:35:09.024 [WARN ] [ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value 'ON' of item HO_NodeRed_IP_Online with format '%1$ta %1$tR': a != java.lang.String
Is there a way to prevent the exception and still keep the functionality?
Thanks guys, it was exactly the poke I needed, this has been bugging me for weeks and I could not work out why either, it survives across reboots and when I went off looking for the items definitions I realised that this must have started when I went through a cleanup period to move many thing and item definitions to PaperUI something I am still in the process of doing.
It turns out I had deleted the item HO_NodeRed_IP_LastSeen and not created it through PaperUI
I will now create the missing item and expect it will solve the error.
Well back to this one once again. I am still getting the same errors it did not go away
LOG:
2019-08-26 05:49:12.376 [WARN ] [ui.internal.items.ItemUIRegistryImpl] - Exception while formatting value 'ON' of item HO_NodeRed_IP_Online with format '%1$ta %1$tR': a != java.lang.String
SITEMAP:
Text item=HO_NodeRed_IP_LastSeen icon=network label="Node Red Last Seen [%1$ta %1$tR]" visibility=[HO_NodeRed_IP_Online==ON]
Text item=HO_Plex_IP_Online icon=network label="Plex Online" visibility=[HO_Plex_IP_Online==ON]
I have both items defined in PaperUI
Checking the two defined items in REST provides this outcome:
Assuming @LeftHanded has not spotted the problem for you - that the Item HO_NodeRed_IP_Online referred to in the visibility actually exists and has a valid state.
This could be UI specific - could you try viewing the sitemap with a different UI?
This is a WARN not an error - what effect does it have in the UI, a line unexpectedly shown or hidden perhaps?
SITEMAP: Whole frame so I get it all correctly shown.
Frame label="Network" {
Text item=HO_NodeRed_IP_Online icon=network label="Node Red Online" visibility=[HO_NodeRed_IP_Online==ON]
Text item=HO_NodeRed_IP_Online icon=network label="Node Red Last Seen [%1$ta %1$tR]" visibility=[HO_NodeRed_IP_Online==OFF]
Text item=XiaomiGW_Online icon=network label="Xiaomi Gateway Online" visibility=[XiaomiGW_Online==ON]
Text item=XiaomiGW_LastSeen icon=network label="Xiaomi Gateway Last Seen [%1$ta %1$tR]" visibility=[XiaomiGW_Online==OFF]
Text item=HueHub_Online icon=network label="Hue Hub Online" visibility=[HueHub_Online==ON]
Text item=HueHub_LastSeen icon=network label="Hue Hub Last Seen [%1$ta %1$tR]" visibility=[HueHub_Online==OFF]
}
Does the sitemap work fine (so without errors) if you remove the visibility code?
Sitemap looks like this with the current code and Online. ONLINE
Thank you so much!
And apologies if anyone is wondering the avatar of a blind man with a cane is correct, I am actually legally blind although not an excuse we all have problems sometimes seeing the wood for the trees.
Yes, don’t feel bad.
I have just spent ten minutes looking for the difference between the broken line and the good version, too.
Usability suggestion for this kind of thing;
instead of visibility test for ==OFF you can use !=ON, “not on”, which is not quite the same and will match NULL and UNDEF as well as OFF
Funny you should mention that, I realised that it could be improved when I was digging into the issue but I waited until I found the fix before I changed it, so thank you for mentioning it. I have indeed set it !=ON.