Meek MT3 with MQTT(...
 
Share:

Meek MT3 with MQTT(domoticz) and day\night lighting  

  RSS

Arsenius
(@arsenius)
New Member
Joined: 4 months ago
Posts: 1
03/12/2018 6:23 pm  

Hello All,

I have received my MT3 and it took me some time to set it up working with domoticz i thought i should share my settings.

So my setup involves Domoticz and a Mosquitto MQTT servers.

ESPeasy has a Domoticz MQTT options at the controller settings.
I have my Domoticz MQTT settings set to Hierarchical so i need to assign the device to a floor and roomplan.
That Room\Floorplan combination will be the Topic where the Switch needs to subscribe to.

 Domoticz_settings

meek_controller

To make this work i needed to set each button to its own Device witch has the Domoticz IDX set to it:

 Meek_controller

Then I also wanted the LEDs on the Switch to have a different color set during day\night.(I wanted to match this feature with my existing Z-wave wall switch).
For this I have set the 4th variable from the Meek dummy device to Backlight as shown in the above image.
In Domoticz I have a Dummy switch called Wallswitch_backlight, It has a schedule so its On during nighttime and Off during daytime.
I have setup a Event in Domoticz with the following dzVents code:

return {
active = true,

on = {
devices = { 'Wallswitch_backlight' },
},
execute = function(domoticz, device)
if (device.state == 'On') then
domoticz.openURL('http://<meek IP>/control?cmd=event,BacklightOn')
else
domoticz.openURL('http://<meek IP>/control?cmd=event,BacklightOff')
end
end
}

The ESPeasy rulesets to make this function !:

Rules Set 1 Rules Set 2 Rules Set 3 Rules Set 4

on Touch1#Button1=1 do
if [Meek#Switch1]=0
gpio 5,1
TaskValueSet 2,1,1
else
gpio 5,0
TaskValueSet 2,1,0
endif
endon

on Switch1#Switch=1 do
if [Meek#Backlight]=0
nfx,one,1,c90000
else
nfx,one,1,770b77
endif
gpio 5,1
endon

on Switch1#Switch=0 do
if [Meek#Backlight]=0
nfx,one,1,000000
else
nfx,one,1,000b44
endif
gpio 5,0
endon

on Touch2#Button2=1 do
if [Meek#Switch2]=0
gpio 4,1
TaskValueSet 2,2,1
else
gpio 4,0
TaskValueSet 2,2,0
endif
endon

on Switch2#Switch=1 do
if [Meek#Backlight]=0
nfx,one,2,c90000
else
nfx,one,2,770b77
endif
gpio 4,1
endon

on Switch2#Switch=0 do
if [Meek#Backlight]=0
nfx,one,2,000000
else
nfx,one,2,000b44
endif
gpio 4,0
endon

on Touch3#Button3=1 do
if [Meek#Switch3]=0
gpio 15,1
TaskValueSet 2,3,1
else
gpio 15,0
TaskValueSet 2,3,0
endif
endon

on Switch3#Switch=1 do
if [Meek#Backlight]=0
nfx,one,3,c90000
else
nfx,one,3,770b77
endif
gpio 15,1
endon

on Switch3#Switch=0 do
if [Meek#Backlight]=0
nfx,one,3,000000
else
nfx,one,3,000b44
endif
gpio 15,0
endon

on System#Boot do
gpio,5,0
gpio,4,0
gpio,15,0
nfx,all,ff0000
delay,3000
gpio,16,1
nfx,all,252525
endon

on CalibrateTouch do
gpio,16,0
nfx,all,ff0000
delay,5000
gpio,16,1
nfx,all,252525
endon

on BacklightOn do
if [Meek#Backlight]=0
TaskValueSet 2,4,1
endif
if [Meek#Switch1]=0
nfx,one,1,000b44
else
nfx,one,1,770b77
endif
if [Meek#Switch2]=0
nfx,one,2,000b44
else
nfx,one,2,770b77
endif
if [Meek#Switch3]=0
nfx,one,3,000b44
else
nfx,one,3,770b77
endif
endon

on BacklightOff do
if [Meek#Backlight]=1
TaskValueSet 2,4,0
endif
if [Meek#Switch1]=0
nfx,one,1,000000
else
nfx,one,1,c90000
endif
if [Meek#Switch2]=0
nfx,one,2,000000
else
nfx,one,2,c90000
endif
if [Meek#Switch3]=0
nfx,one,3,000000
else
nfx,one,3,c90000
endif
endon

This topic was modified 4 months ago 5 times by Arsenius

Quote
Close Menu
×
×

Cart

  
Working

Please Login or Register