Dashboard behaves erratically

The dashboard seems to behave erratically. I have 5 switches type boolean. All works ok if the dashboard is not closed which means when I slide a switch the device switches on and off as desired but lets say I leave the devices on and close the dashboard either on the pc or on the remote application on mobile when I open the dashboard again all switches show off state where as the actual electrical device is on. This has been happening form the last 2 days before all was ok.
Please Help.

Hello
Post your sketch, well formated, with comments and in so called code tags "</>" and schematic to see how we can help.
Have a nice day and enjoy coding in C++.