Hi there!
I'm having some issues with OBK autodiscovery related to HomeAssistant.
I suppose I'm doing something wrong... or do not actually understand how things (should) work in OBK so after quite some trial and errors I decided to start bothering here...
Hopefully it's just my wrong doing (not understanding) and not something else...
What am I trying to accomplish:
- define "functionalities" in OBK web config (define pins, pwms, buttons...)
- issue HA Autodiscovery from OBK to get the device/entities shown/configured in HomeAssistant
Some basic options seems to work OK (declaring pin as Button + declaring pin as Relay for the same button produces a "switch" in HA; declaring a pin as "dInput" also produces a "binary sensor" in HA...) so this is "ok", I suppose.
The issues start with PWM lights/dimmers.
I have a 4-channel dimmer where I would like to use each channel as a simple Dimmer - just "brightness" for four different lights.
So, configured pins 6,7,8,9 as PWM and set the relevant pins "channelType" to "Dimmer" through webApp
But... after autodiscovery I get a single "light" device in HA with the RGB, color... properties instead of 4 simple "dimmers".
I thought the problem could be that OBK is by default taking consecutive "channels" as RGB elements and so "publishes" just one light... so I configured the pins as 6,7,8,9 as PWM1, PWM10, PWM20, PWM30 hoping to get 4 separate "lights" and... it half-worked!
In the OBK HA Config the configuration is nicely shown BUT the autodiscovery in HA has NO LIGHTS whatsoever?!


Also... the channels in MQTT are "just something" (6,7,8,9) instead of 1,10,20,30 as they should be. Also, the "led_dimmer" etc is just ONE instead of for each channel (as I understand).
How can I configure the OBK device to autodiscover 4 (simple) dimmers in HA?
I know I could copy-paste the suggested HA config in config.yaml but that is ugly and requires constant edits/corrections on two places (device+config file)
The generated HA config (or manual changes) IS NOT sent to HA by "start HA autodiscovery", right? It's there just for "copy to clipboard", right?
Also... is it possible to "configure" the pins to be discovered as TRIGGERS (buttons) in HA? As the HA docs say the triggers are not allowed to be defined in the confg.yaml but (only) through autodiscovery?
Buttons should really act as triggers in HA (NOT binary sensors where you have to check transitions from on->off or off->on) - to be real triggers/events. That would greatly simplify multi-function buttons (single, double triple press, short press, long press...)
How does any "automatic behavior" linked to pins (PWM for example, acting as RGBC(W) lights by default) behave when you start to add event handlers etc in OBK? Does the "automatic behavior" stay intact? (ex publishing and listening to led_dimmer... led_brightness...)
Is there any way of using "variables" (other than channels) in PUBLISH/SUBSCRIBE commands in OBK scripts/handlers like for example, to use "short name", "full name", "mqtt base topic"? This way the script could be the same and would automatically use the correct names/topics for MQTT commands. (after making event handlers/scripts for btn presses or dimmer handling etc)