MQTT PWM Dimming led on Arduino

OK so here’s the deal, I built an MQTT arduino device with an led strip attached, all I wanna do is update a value between 0 and 100 and send via MQTT message.

When I use the paho utility:
I can send a value with the correct subject and the corresponding led will light to that value no problem

I also have a temp and humidity sensor connected it reports every 30 seconds, that seems to work fine,

the problem is if I change the value from openhab, It doesn’t send any MQTT message at all
I’m subscribed to * in the paho utility so I should see something, but no message at all. I think it’s an issue with my item binding which looks like this:

Dimmer FTRled “RED [%d %%]” (lr) {mqtt=">[myBroker:CONTROL/LIGHTUPDATE/RED:state:*:default]"}

any help would be very much appreciated


This is exactly was i made with a nightlight.
You can find all OpenHab Config Files and my arduino Code on my Site under its in German but you will unterstand the Code.

1 Like

For me the following item definition is working:

Dimmer	DIM_00_00	"Licht EG Spots Wohnzimmer"	(gEGWohnzimmer)		{mqtt=">[phc:/phc/ToPHC/STM/00/DIM/00/00:command:*:default]"}

I think you need to change “state” into “command” in your definition.


if “setfrequency” is not in your sitemap slider wont send any message to mqtt

example of how to use
Slider item=ledd sendFrequency=1 label=“LED-light” icon=“slider”

Dimmer ledd “Dimmer” {mqtt=">[broker:/test/esp_test_1/led:state:*:default]"}

also note that either command or state will work