Bei basic.flip true,false einfach weglassen.
Ob man nun true, false oder 1,0 oder 'true','false' in den Widgets (z.B. basic.checkbox) verwendet sollte kein Unterschied machen, da die Typenkonvertierung in smartVISU 3.3.0 dies wieder korrigiert. Also wenn ioBroker ein boolean liefert so schreibt smartVISU 3.3.0 auch ein boolean wieder zurück.
Ich habe dazu eine Objekt definiert:
{
"common": {
"name": "boolean Test",
"type": "boolean",
"def": false,
"role": "state"
},
"native": {},
"type": "state",
"_id": "0_userdata.0.boolean_value",
"acl": {
"object": 1636,
"state": 1636,
"owner": "system.user.admin",
"ownerGroup": "system.group.administrator"
},
"from": "system.adapter.admin.0",
"user": "system.user.admin",
"ts": 1671443159460
}
In einer smartVISU Testseite die zu testenden Widgets definiert:
<div class="block">
<div class="set-2" data-role="collapsible-set" data-theme="c" data-content-theme="a" data-mini="true">
<div data-role="collapsible" data-collapsed="false">
<h3>boolean value test</h3>
basic.checkbox {{ basic.checkbox('', '0_userdata.0.boolean_value', 'boolean', true, false) }}<br>
basic.stateswitch {{ basic.stateswitch('', '0_userdata.0.boolean_value', 'icon', [true,false], ['jquery_plus.svg', 'jquery_minus.svg']) }}<br>
basic.flip {{ basic.flip('flip', '0_userdata.0.boolean_value') }}<br>
{{ basic.print('', '0_userdata.0.boolean_value', '%s' , 'VAR==1?"true":"false"') }}<br>
</div>
</div>
</div>
Und dies getestet:
Dies sieht man in Log (ioBroker):
socketio.0 2022-12-21 19:19:49.419 silly States user redis pmessage 0_userdata.0.boolean_value/0_userdata.0.boolean_value:{"val":true,"ack":false,"ts":1671646789416,"q":0,"from":"system.adapter.socketio.0","user":"system.user.admin","lc":1671646789416}
socketio.0 2022-12-21 19:19:47.064 silly States user redis pmessage 0_userdata.0.boolean_value/0_userdata.0.boolean_value:{"val":false,"ack":false,"ts":1671646787061,"q":0,"from":"system.adapter.socketio.0","user":"system.user.admin","lc":1671646787061}
socketio.0 2022-12-21 19:19:44.001 silly States user redis pmessage 0_userdata.0.boolean_value/0_userdata.0.boolean_value:{"val":true,"ack":false,"ts":1671646783998,"q":0,"from":"system.adapter.socketio.0","user":"system.user.admin","lc":1671646783998}
socketio.0 2022-12-21 19:19:41.201 silly States user redis pmessage 0_userdata.0.boolean_value/0_userdata.0.boolean_value:{"val":false,"ack":false,"ts":1671646781198,"q":0,"from":"system.adapter.socketio.0","user":"system.user.admin","lc":1671646781198}```