Change UI_Switch status (true or false) at Runtime

Hi,

After a query in Mysql, I display the data on regular UI_textbox and I would like to use ui_switch do display by boolean fields data.

So far, no success, the ui_switch never change according to received field value (true or false). IF I use a timestamp and sending true or false manually, the switch status change on the site dynamically.

Any idea what wrong I do?

Thanks a lot for your help

Yves

Here the switch config:

image

Add a debug to check the message you are sending to the switch and check that msg.payload is set to true or false

Particularly check whether it is boolean true or string "true"

Colin, thanks, it was "true" and not true !!

I will make proper corrections in mysql table for boolean values....

Thanks a lot .. it is very appreciated

Yves

Works just fine... Thanks a lot