MQTT dimmer command payload help

Hello,

How do I include the word Dimmer in the MQTT payload

I’m working with a Armtronix Dimmer https://www.tindie.com/products/Armtronix/wifi-esp8266-based-single-triac-dimmer-board/ and after emailing the developer it appears that the mqtt payload needs to include the word Dimmer i.e.

topic: /esp/dimmer01/sub
payload Dimmer:50

Here’s the regular command. The problem is the payload is only the numerical value

{mqtt=">[mosquitto:/esp/dimmer01/sub:command:*:default]"}

Any idea?

Looking at the MQTT README examples:

Switch mySwitch {mqtt=">[mybroker:myhouse/office/light:command:ON:1],>[mybroker:myhouse/office/light:command:*:Switch ${itemName} was turned ${command}]"}

So

{mqtt=">[mosquitto:/esp/dimmer01/sub:command:*:Dimmer\\:${command}]"}

Note that you will probably have to play around to find the right way to escape the : between Dimmer and ${command}.

Thank you @rlkoshak… That resolved my problem. Here’s the final product.

Topics in the ESP web server configuration

pubTopic: /esp/dimmer01/pub
subTopic: /esp/dimmer01/sub

OpenHab Items

Switch        ESPSwitch01        "ESP light1"                                     (All,Test)        {mqtt=">[mosquitto:/esp/dimmer01/sub:command:on:R14_ON],>[mosquitto:/esp/dimmer01/sub:command:off:R14_OFF]"}
Switch        ESPSwitch02        "ESP light2"                                    (All,Test)        {mqtt=">[mosquitto:/esp/dimmer01/sub:command:on:R13_ON],>[mosquitto:/esp/dimmer01/sub:command:off:R13_OFF]"}
Dimmer        ESPDimmer01        "ESP Dimmer"                <slider>            (All,Test)        {mqtt=">[mosquitto:/esp/dimmer01/sub:command:*:Dimmer\\:${command}]"}

OpenHab rule.

// rule to resolve dimmer max limitation of 99
rule "Set ESP Dimmer to 99 from 100"
when   
    Item ESPDimmer01 changed to 100
then   
    sendCommand(ESPDimmer01, 99)
    end 

Shopping list

ESP Dimmer from Armtronix
https://www.ebay.com/i/332519078965 (maybe he’ll restock soon)

Housing from Lowe’s
https://www.lowes.com/pd/Wiremold-NMW-1-Piece-White-Raceway-Electrical-Box/3152539

The ESP Dimmer from Armtronix in this posted has been phased out and replaced with this one.

Pls share sitemap file… i m not able to open because of sitemap file is not available.

Regards,

Thale

hello i have the same dimmer same problem the armtronix guy keep saying Dimmer:50 the only problem is that i am using Home Assistant not Openhab was using openhab earlier. is there a way you could point me also in right direction have been struggling for past 6 months

Home assistant forum?

they are not helping man and the armtronix guy just say dimmer:60 70 80 and i am sure there is no language barrier as we both are from India and speak same language

will be very thankful

Gagan

I don’t use HA, come back to openHAB and we’ll talk again

Hello everyone,

I am working on Dimmer with openhab ,Raspberry pi(Working as server) and esp8266. Kindly help me to make sitemaps and bindings file for it.

I am following ARMtronix code.

We will need more details to point you in the right direction.
What protocol are you using to send command to the ESP? MQTT?

Sir actually i am working on home automation system and i am able to control my lights from anywhere with the help of MQTT protocol.I have installed openhab on raspberry pi.
But now from few days i am trying to make a dimmer. I have done the testing of my hardware with arduino uno and its working accurately.
With step 8.

But now i want control it with the help of openhab application as well. But #include<TimerOne.h> is not working for ESP8266. Its giving error while compilation.
Then i followed the code given by ARMtronix. But its not working yet.
Please help me in that.

This is an OH furom, not ESP8266, did you contact ARMTronix?

You need to install the TimerOne library in the arduino IDE

Yes i have done that but thats only working for ATmega but for ESP its giving compilation Error.

Or

Could you please help me to make the sitemaps,bindings and rules file According to ARMtronix hardware?
This is the link for their code.

Alright Thank you sir. I will work on it.