2-State Widget works in app but not website dashboard

one thing i noticed is, you are not adding a unit_value to the client.virtualWrite. Have a look at this Data types for Cayenne MQTT API and add the appropriate unit_value to it. You might want to delete the previously created 2 state sensor widget from the dashboard and let the code auto populate green widget on the dashboard. Add them by clicking on “+”.