I iterate over all my Shelly devices for two specific items (qualitiy of signal, operating temperature). Some of my shellies do not provide operating temperature, thus there is no item defined for that thing. The widget in general works fine.
What I try to work around is a missing function like “if exist item xyz”.
In the following yaml code you see that I have an oh-repeater within an oh-repeater and that the name of the item consists of two repeater names.
The items[] call returns - not a falsy value when it is called with an item name that doesn’t exist. So your condition in all of the examples is always returning true. In this case, because the loop object behaves in a more standard way, you can just test the loop object directly. Something like:
Hi Justin,
thanks for your help. loop.rThing.name (which is the item’s prefix) and loop.rItem (which is the item‘s suffix) do always exist in each loop. But one cannot know if the resulting item name really exists.
So I think at first we have to create the entire item name and then we need to check if that item exists.
obviously then creates lots of error messages such as
[WARN ] [e.internal.SseItemStatesEventBuilder] - Attempting to send a state update of an item which doesn't exist: ShellyGartenWandlampe_Geratetemperatur
There really is not. The widget system has been designed from the beginning to minimize the information required in order to permit smooth user experience in the broadest number of cases. Very few widgets would require this information so including a complete list of item names in the packet passed to every widget would be a significant drag on resources for little benefit. A Warn message in the logs is really not an issue that needs to be addressed.