Connect cz2020 badge from badge.team to home-assistant as binary sensor and rgb light.
16 buttons and lights are automatically detected by homeassistant using MQTT. Button numbers are from 0 to 15 github
Make sure to put the correct settings in the app settings menu of https://webusb.hackz.one. Set the server ip of the mqtt server of homeassistant (usually the same ip as your homeassistant). Optionally set the port, username and password. Make sure MQTT and autodiscovery are enabled in your homeassistant config. Choose any device name for the device (default: cz2020) and optionally change the discovery prefix.
On startup, all keys turn red. The first row turns orange when starting connect to wifi, and to green if wifi connection was successful. The second row turns orange when connecting to the mqtt server, and to green if connected successful. If the second doesn't turn green, check the mqtt server address in the settings of https://webusb.hackz.one The third and fourth row turn orange when starting programming of homeassistant and setting all states to available, and green on success.
In the homeassistant website, navigate to 'Configuration' and click 'Devices".
Basic structure based on: https://badge.team/projects/mqtt_button Light structure based on: https://github.com/mertenats/open-home-automation/tree/master/ha_mqtt_rgb_light