@Ralla66
Hallo und danke für deine Antwort. 0 und 1 ist nicht vertauscht. Der Aufbau der VISU ist html und css basiert. In diesem Aufbau wird auf vogefertigte Widget bausteine zugegriffen. In diesem Fall auf das basic.stateswitch widget, welches durch nachfolgendes Vorgabenbeispiel beeinflusst werden kann
{{ basic.stateswitch(id, item, type, value, icon, text, color, indicator, item_longpress, value_longpress, value_longrelease) }}
id
unique id for this widget (optional)
item
an item
type
valid types: 'micro', 'mini', 'midi', 'icon', 'text' (optional, default: mini)
value
array of values (optional, default [0,1])
If the item has a value that is not part of the list, the state (icon, text, color) of the last value in the list will be shown.
icon
array of icons (optional, default just if text is empty: control_on_off.svg)
dynamic icons can be used, e.g. icon.light('', '', value_item); please note: these must not be wrapped by apostrophs (')
text
array of texts (optional)
color
array of colors; 'icon1' or e. g. '#f00' for red (optional, default: icon0)
additionally you can use 'hidden' to not diplay at all or 'blank' to make it invisible but preserve the space that would be used.
indicator
activity indicator which is active until response (or a timeout of 3 seconds is reached); pass either a color, 'icon1' or 'blink' (optional)
item_longpress
an item to which a value on longpress is sent (optional)
value_longpress
the value to send on longpress (optional)
If this starts with a + or - sign the value is treated as offset to current stateswitch value.
value_longrelease
the value to send on releasing after a longpress (optional)
Dieses sieht im Beispiel meiner Visu wiefolgt aus:
<tr>
<td style="width:25%">{{ basic.stateswitch('', 'javascript.0.SmartVISU.Beleuchtung.Kueche.Dunstabzug', 'icon', ['1', '0'], ['light_kitchen_hood.svg', 'light_kitchen_hood.svg'], '', ['icon1', 'icon0']) }}</td>
<td align="left">Licht Dunstabzugshaube</td>
</tr>
Hierbei benötige ich nur das Item (Datenpunkt in IoBroker), das Type (in dem Fall ein Icon), das Value (1 oder 0 bzw. true oder false), das Icon (Icon Darstellung als svg Datei in dem Fall eine Dunstabzugshaube) und das Color (Farbe des Icon für 0 oder 1 Wert)
Das funktioniert bei Homematic-, Homematic IP-, KNX- und Wemos (über MQTT) Aktoren einwandfrei. Lediglich mit Belkin Wemo (über HAM Adapter) und Sonoff Aktoren leider nicht.
Und ich weiß einfach nicht, wo ich den Fehler suchen soll...
Gruß
Jochen