AtomBaf / homebridge-mqtt-tasmota

Homebridge handler for tasmota/MQTT devices
MIT License
5 stars 5 forks source link

Dimmer switch #7

Closed boboxx closed 2 years ago

boboxx commented 2 years ago

are dimmer switch supported?

AtomBaf commented 2 years ago

Unfortunately I haven't got one at home, so no support as of today.

What type of tasmota dimmer switch do you have?

If you don't mind, I can add it 'blindly' and let you try it. This is not an ideal test setup and will probably require some back-and-forth deployments. Would you agree with this?

boboxx commented 2 years ago

This is the Tasmota template I'm using: https://templates.blakadder.com/treatlife_DS02S.html

I would be happy to test!

AtomBaf commented 2 years ago

So lets go: I just published a new 0.5.3 version with a new type of accessory called lightbulb You might try it by just replacing the switch keyword in your setting file.

Then, you will notice your switch will appear as a lightbulb, and with a dimmer. It works on my side for the ON/OFF part, tell me if it is okay on your side with the dimmer part

boboxx commented 2 years ago

I havent had a chance to install the dimmer switch yet. how do you configure the dimming range?

AtomBaf commented 2 years ago

no range setting yet. Just waiting for your tests.

boboxx commented 2 years ago

Ok finally loaded Tasmota on a DS02S and the basic ON/OFF is working. What's next?

AtomBaf commented 2 years ago

I just released a 0.5.4 version. It should forward the HomeKit brightness order to your tasmota

If not, could you go to the tasmota console of your device and check that the command dimmer 50 for instance is working?

boboxx commented 2 years ago

I updated, but it dosent look like the damming command is getting passed. if I look at my Tasmota build I get: 15:20:11.121 MQT: stat/tasmota_215B7C/RESULT = {"POWER":"OFF"} 15:20:11.125 MQT: stat/tasmota_215B7C/POWER = OFF 15:20:11.225 MQT: stat/tasmota_215B7C/RESULT = {"POWER":"ON"} 15:20:11.227 MQT: stat/tasmota_215B7C/POWER = ON 15:20:11.711 MQT: stat/tasmota_215B7C/RESULT = {"POWER":"ON"} 15:20:11.716 MQT: stat/tasmota_215B7C/POWER = ON 15:20:11.788 MQT: stat/tasmota_215B7C/RESULT = {"POWER":"ON"} 15:20:11.793 MQT: stat/tasmota_215B7C/POWER = ON 15:20:12.112 MQT: stat/tasmota_215B7C/RESULT = {"POWER":"ON"} 15:20:12.115 MQT: stat/tasmota_215B7C/POWER = ON 15:20:12.665 MQT: stat/tasmota_215B7C/RESULT = {"POWER":"ON"} 15:20:12.668 MQT: stat/tasmota_215B7C/POWER = ON 15:20:12.740 MQT: stat/tasmota_215B7C/RESULT = {"POWER":"ON"} 15:20:12.743 MQT: stat/tasmota_215B7C/POWER = ON 15:20:12.806 MQT: stat/tasmota_215B7C/RESULT = {"POWER":"ON"} 15:20:12.811 MQT: stat/tasmota_215B7C/POWER = ON

all the power on are me sliding the slider.

I know the dimmer works when using the web console: 15:24:09.166 CMD: dimmer 50 15:24:09.173 MQT: stat/tasmota_215B7C/RESULT = {"POWER":"ON","Dimmer":50}

AtomBaf commented 2 years ago

Hi Sorry for delay. Still, we are progressing. On my side I tested on a basic sonoff device. I added a 'lightbulb' device in the homebridge plugin and can see in Apple Homekit the lightbulb with its dimmer control. There are 2 distinct commands handled by the plugin. Power (ON/OFF) and Dimmer (0 to 100). When Homebridge receives the power command from the Apple device, it is translated to a MQTT publish message. For your setup it should be something like: cmnd/tasmota_215B7C/power ON You can test it from your device's console by entering. (you can also test it with a MQTT tool like MQTT explorer) publish cmnd/tasmota_215B7C/power ON Can you confirm this is working?

Similarly, the command Dimmer (as stated in the tasmota doc and as successfully tested on your device) should be forwarded from the apple device, then to a MQTT message like this one: cmnd/tasmota_215B7C/Dimmer 50 Can you test your device is listening to this message by typing: publish cmnd/tasmota_215B7C/Dimmer 50

I'm just realizing when writing this comment that the actual command you typed is dimmer without the capital D. Still, the received result is with a capital letter. The tasmota device might be sensitive to that, could you also test the above publish command with upper/lower cases?

Thanks for your help (and patience)

AtomBaf commented 2 years ago

Update: I just setup a Sonoff Basic as a Sonoff D1 (dimmable switch) Even if obviously the lamp is not working, I can see the log file of the device and can confirm that:

I'm using Tasmota version 10.1.0. What's yours?

Update2: I setup my tasmota module as indicated here to reflect your setup. I only did a BackLog TuyaMCU 21,2;SetOption20 1;SetOption54 1 as indicated to enable the dimmer command. And I can confirm that the device is correctly responding to the MQTT messages.

boboxx commented 2 years ago

Ok happy to report that it all working! I think the issue I had was with my test bulb!