Meek Wifi Wall Switch

Everything about esp8266 and more.

Moderator: leecollings

Meek
Posts: 41
Joined: Monday 16 October 2017 23:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Meek Wifi Wall Switch

Post by Meek »

Update Dec2017:
The switches are evolving and I’ve already reached the Beta phase. The main functions are fully operational.

I’m now concentrating on the extra modules/functions that can be integrated into the Meek switches.

At this stage I’m trying to integrating a RWCL-0516 radar motion sensor into the Meek switch. I’m struggling to resolve the interference between the ESP8266 and the RWCL-0516 sensor.
In the new Beta’s, the antennas of the ESP8266 & RWCL-0516 are separated as “far as possible” on the PCB’s, also added some extra electronic components to eliminate fluctuations on the power lines.
If you have any thoughts on resolving the interference, please let me know.

Next week, I hope to receive all the components to assemble the Beta 7 versions of the Meek switch.
As we’re nearing the release of the first switches, I’ve included extra safety measures like a varistor, thermal fuses and off course a regular fuse.

If you have any thoughts or remarks, please let me know.
120171211_184009.jpg
120171211_184009.jpg (146.48 KiB) Viewed 4652 times
120171213_221424.jpg
120171213_221424.jpg (119.82 KiB) Viewed 4652 times
Arsenius
Posts: 8
Joined: Thursday 23 April 2015 7:47
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Meek Wifi Wall Switch

Post by Arsenius »

Looks really cool Meek.
I dont know how to solve the interference but i dont think you need a motion sensor on each wall switch but in a few it could be very handy.
Im looking forward to see this when the project is complete.
Meek
Posts: 41
Joined: Monday 16 October 2017 23:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Meek Wifi Wall Switch

Post by Meek »

Good point, as I’m in the developmental phase, it’s nice to explore the possibilities, but your right, the development process should not be overtaken by a “gimmick”.

Nevertheless, I’ve assembled the Meek switch with an integrated RCWL-0516 module and with all the filters, the accuracy improved enormously. That been said/written, in the first night where I tested the Meek switch, he gave 3 “false positives” during a 9 hours trial.

I’ve setup the switch in my kitchen that overlooks at our garden. It could be possible that there were some animal activities that has been captured by the sensor but I cannot tell for sure. But no matter what caused the “false positives” the results was not satisfactory.
So I went back to do more testing and measuring and found that by repositioning the sensor (although it’s a 360degree sensor) the accuracy improved even more !

Tonight, I will conduct a test in my attic to rule out any “jammers”.
I’ll keep you posted.
Meek
Posts: 41
Joined: Monday 16 October 2017 23:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Meek Wifi Wall Switch

Post by Meek »

The last test over a period of 10 hours, had a hit rate of 100%.
Now I need to finalize the code/rules to operate on motion once the Lux meter drops to a certain level.
After that, I will install it in my kitchen an post a video of the operation.
Meek Beta6 RCWL0516.PNG
Meek Beta6 RCWL0516.PNG (110.21 KiB) Viewed 4543 times
Arsenius
Posts: 8
Joined: Thursday 23 April 2015 7:47
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Meek Wifi Wall Switch

Post by Arsenius »

what is your goal with the code to check motion only when its dark? to use as a alarm or something?
If so, would you not want to do that in domoticz and not in the firmware of the switch\sensor.
Meek
Posts: 41
Joined: Monday 16 October 2017 23:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Meek Wifi Wall Switch

Post by Meek »

I have finally accomplished the fully integration of a Doppler radar into the Meek switch. As promised, I’ve uploaded a video on YouTube of the newest Meek switch in action.


The development continues and I’m almost ready to release the first small quantities of the Meek switches to the public. I’ll keep you informed ;)
miremi
Posts: 26
Joined: Sunday 08 November 2015 10:08
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Meek Wifi Wall Switch

Post by miremi »

Cool :) Looking forward to buy some of this switches from you
Ubuntu 16.04.3, Core i5 8GB RAM 120GB SSD, RFlink, ESPeasy, Z-Stick Gen5, 8 FIbaro, 17 Neo Coolcam
Meek
Posts: 41
Joined: Monday 16 October 2017 23:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Meek Wifi Wall Switch

Post by Meek »

Herewith a picture of the PCB designs that will make it into the production models.

As the development of these Meek switches are nearing completion, I’m shifting my focus on the expansions.

One of the most requested expansion is, by far, the Meek dimmable Wifi Enabled Smart Switch.
Once I have some info to share, I will report it here.

I’m also doing my utmost to have the website available at : http://www.meek-ha.com/
In the future, I will post some manuals and programming guides for the home automation systems and, ofcourse, manuals with the Meek Switches.

Thank you for your interest in this project !
1.jpg
1.jpg (136.98 KiB) Viewed 4376 times
kluczus
Posts: 24
Joined: Tuesday 12 September 2017 14:39
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Meek Wifi Wall Switch

Post by kluczus »

Meek wrote:Herewith a picture of the PCB designs that will make it into the production models.

As the development of these Meek switches are nearing completion, I’m shifting my focus on the expansions.

One of the most requested expansion is, by far, the Meek dimmable Wifi Enabled Smart Switch.
Once I have some info to share, I will report it here.

I’m also doing my utmost to have the website available at : http://www.meek-ha.com/
In the future, I will post some manuals and programming guides for the home automation systems and, ofcourse, manuals with the Meek Switches.

Thank you for your interest in this project !
1.jpg
Great work!
........................................................................................
RPi2 + sonoff + 433MHz + Xiaomi Gateway + EQ-3 MAX!
iLLiac4
Posts: 17
Joined: Thursday 31 August 2017 8:13
Target OS: -
Domoticz version:
Contact:

Re: Meek Wifi Wall Switch

Post by iLLiac4 »

So these are made for traditional wire and not like sonoff?
So it is usable for wireing with only 'live' wire?
How did you achive that because SonOff touch has mandatory for Live and N wire to be present?

Since you have a lot of knowlage would it be possible to mod ordinary sonoff touch to use only 'live' wire to operate?

TNX
User avatar
htilburgs
Posts: 464
Joined: Tuesday 03 November 2015 11:01
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Meek Wifi Wall Switch

Post by htilburgs »

Following this item with great interest. Magnificent work!
Can we switch the switch on / off from Domoticz?

For example:

Code: Select all

http://192.168.0.100:8088/json.htm?type=command&param=switchlight&idx=522&switchcmd=On
http://192.168.0.100:8088/json.htm?type=command&param=switchlight&idx=522&switchcmd=Off
Hardware:
RPi3 - Aeon Labs Z-Stick GEN5 - Fibaro Dimmer 2 - Fibaro Roller Shutter 2 - Fibaro Smoke Sensor - Yeelight RGBW Led bulb - Yeelight Smart LED Light Strip - Neo Coolcam PIR Motion Sensor - Neo Coolcam PowerPlug - Nest Thermostat v3
Meek
Posts: 41
Joined: Monday 16 October 2017 23:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Meek Wifi Wall Switch

Post by Meek »

iLLiac4 wrote: Saturday 06 January 2018 4:48 So these are made for traditional wire and not like sonoff?
So it is usable for wireing with only 'live' wire?
How did you achive that because SonOff touch has mandatory for Live and N wire to be present?

Since you have a lot of knowlage would it be possible to mod ordinary sonoff touch to use only 'live' wire to operate?

TNX
In my design you will need Neutral as well. I have explored the option with just Live- & Switch-wire, but the power stability was not encouraging to pursue this further.

After safety, the most important point was stability. With that in mind, during the design process, 1 wire option failed on stability. Therefore I have abandoned this option in an early stage.
But with the current design, the Meek switches are running rock solid and as power feed is independent and stable, we can add beautiful expansions to it that depends on a “clean” power supply (for instance the RCWL-0516).
Meek
Posts: 41
Joined: Monday 16 October 2017 23:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Meek Wifi Wall Switch

Post by Meek »

htilburgs wrote: Saturday 06 January 2018 10:27 Following this item with great interest. Magnificent work!
Can we switch the switch on / off from Domoticz?

For example:

Code: Select all

http://192.168.0.100:8088/json.htm?type=command&param=switchlight&idx=522&switchcmd=On
http://192.168.0.100:8088/json.htm?type=command&param=switchlight&idx=522&switchcmd=Off
Yes, you can, in fact, I’m working on a small manual on how to include the Meek devices in your own domotica system ( http://www.meek-ha.com/manuals/meek-mt1-information/ ).

Toggle function is a standard option and I will include the On/Off option in the ESPEasy Rules as well.

Thank you for pointing this out and if you have other suggestions, please do share it with us.
poudenes
Posts: 667
Joined: Wednesday 08 March 2017 9:42
Target OS: Linux
Domoticz version: 3.8993
Location: Amsterdam
Contact:

Re: Meek Wifi Wall Switch

Post by poudenes »

WOW !!! When you're done we can find a webshop to order those?
It's so nice !!!
RPi3 B+, Debain Stretch, Domoticz, Homebridge, Dashticz, RFLink, Milight, Z-Wave, Fibaro, Nanoleaf, Nest, Harmony Hub, Now try to understand pass2php
Meek
Posts: 41
Joined: Monday 16 October 2017 23:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Meek Wifi Wall Switch

Post by Meek »

poudenes wrote: Friday 16 February 2018 16:17 WOW !!! When you're done we can find a webshop to order those?
It's so nice !!!
Thank you for your nice reaction.

The webshop will be available at https://www.meek-ha.com
Meek
Posts: 41
Joined: Monday 16 October 2017 23:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Meek Wifi Wall Switch

Post by Meek »

Just uploaded a video with regards to the development of Meek MD1 ( Meek Wi-Fi enabled Dimmer).

Xavier82
Posts: 178
Joined: Tuesday 07 June 2016 22:09
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Netherlands
Contact:

Re: Meek Wifi Wall Switch

Post by Xavier82 »

Awsome, nice work!

When will the products be available?
Hoe does the Meek MK1 with 2 output lines works? Are there 2 touchbuttons? I would like to controll 2 individual/independant lights.
Are u also planning on making a switch for blinds?
Are the Meek products resistent for LED bulbs?

Keep up the good work!
Meek
Posts: 41
Joined: Monday 16 October 2017 23:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Meek Wifi Wall Switch

Post by Meek »

Xavier82 wrote: Monday 19 February 2018 16:33 Awsome, nice work!

When will the products be available?
Hoe does the Meek MK1 with 2 output lines works? Are there 2 touchbuttons? I would like to controll 2 individual/independant lights.
Are u also planning on making a switch for blinds?
Are the Meek products resistent for LED bulbs?

Keep up the good work!
I have renamed the MK1, to MP1 (Meek Presence, 1 touch button).
In the YouTube Video of MP1,contains 2 outputs and are fully programmable by ESPEasy “Rules” function :
tube]

I have programmed it as follows :
The presence detector, only reacts once the light is below a certain level (see http://www.meek-ha.com/manuals/manual-f ... sence-mp1/ for more details of my own situation).
Once it’s “dark” and body movement (presence) is detected, the Meek MP1 switches on the lights in the kitchen for a duration of approximately 1 minute (timers are fully programmable via ESPEasy rules function). If within the minute, presence is detected, the timers will be reset, so the lights will stay on. If no presence detected, light will be turned off in approximately 1 minute.

The second output, is controlled by the touch button.
Once I press the touch button, my garden lights will be turned on, and on the second press, it will be turned off as a regular switch.

Off course, as it’s connected to Wi-Fi, you can control it within Domoticz, or any other automation system. For the ease of use, I have created a few “Apps” on my android phone with “HTTP Request Shortcuts”, so I can easily turn on and off the lights in every room that has been equipped with the Meek switches.

Besides the MP1, I’m also working on several other options like :
• Meek Dimmer (in developments)
• Meek Motor (for Mechanical Home Ventilation, or as we call in the Netherlands mechanische ventilatie)
• Meek MT2 & Meek MT3(in development)
Meek MT2(Meek Touch 2 buttons) & Meek MT3 (Meek Touch 3 buttons), are also in developments, so you can control 2 or 3 individual lights with 1 Meek wall switch.
Meek
Posts: 41
Joined: Monday 16 October 2017 23:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Meek Wifi Wall Switch

Post by Meek »

I promised to release the code for the Meek MD1 dimmer once all options are integrated and fully operational, but due to shift in priorities and limited time, I am unable to finish the coding on a short notice.

Therefore I’ll publish the “dirty” code for the time being.
It’s still work in progress and 1 of the major things that I’m currently working on, is the synchronization between the dim-levels and Domoticz. So for instance if the dim-level is on 50% on Domoticz, on the ATmega, this correspondence’s with a value around the 380. So when I manually change this to 260, Domoticz should jump to 25%. With the code below, this is fully operational. But, the manual fine-tuning part, still needs to be coded. For instance, if I manually set the dim-level at a value of 261, Domoticz will set it back to 260. So in the coding I have to build a rounding function so it’ll ignore smaller input changes send by Domoticz.

As you can see in the code, I’m trying to code the ATmega328P as flexible as possible, so you can change setting afterwards as you wish. Also flashing the ATmega328P will be somewhat cumbersome without dedicated equipment.
That’s one of the reasons why I want a full set of options and gimmicks as much as possible in the coding. So if you wish additions or have good ideas, please do inform us and if possible, amend the coding 
One of the hardcoding will be something like “disco mode” so the lights will max out and back to minimum in a loop.
Once again, if you have additions or cool idea’s, please share it with us.
Herewith a video of the dimmer in action :


Coding is borrowed from the following sources :
https://playground.arduino.cc/Main/ACPhaseControl
https://github.com/letscontrolit/ESPEas ... tender.ino

Code: Select all



/*
 * ***************************************************************************************************************************\
 * Arduino project "ESP Easy" � Copyright www.esp8266.nu
 *
 * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 * You received a copy of the GNU General Public License along with this program in file 'License.txt'.
 *
 * IDE download    : https://www.arduino.cc/en/Main/Software
 * ESP8266 Package : https://github.com/esp8266/Arduino
 *
 * Source Code     : https://sourceforge.net/projects/espeasy/
 * Support         : http://www.esp8266.nu
 * Discussion      : http://www.esp8266.nu/forum/
 *
 * Additional information about licensing can be found at : http://www.gnu.org/licenses
**************************************************************************************************************************/

// This file is to be loaded onto an Arduino Pro Mini so it will act as a simple IO extender to the ESP module.
// Communication between ESP and Arduino is using the I2C bus, so only two wires needed.
// It best to run the Pro Mini on 3V3, although the 16MHz versions do not officially support this voltage level on this frequency.
// That way, you can skip levelconverters on I2C.
// Arduino Mini Pro uses A4 and A5 for I2C bus. ESP I2C can be configured but they are on GPIO-4 and GPIO-5 by default.



#include <Wire.h>
#include <avr/io.h>
#include <avr/interrupt.h>

#define DETECT 2  //zero cross detect
#define GATE 3    //TRIAC gate
#define PULSE 4   //trigger pulse width (counts)

int Meek;
int StepDown=1;
int StepUp=1;
int InputDelay=100;
int Domoticz;
int Domoticz1;
int Difference ; 
int UpperLimit = 605;
int LowerLimit = 150; 


#define I2C_MSG_IN_SIZE    4
#define I2C_MSG_OUT_SIZE   4

#define CMD_DIGITAL_WRITE  1
#define CMD_DIGITAL_READ   2
#define CMD_ANALOG_WRITE   3
#define CMD_ANALOG_READ    4
#define omhoog 8 
#define omlaag 12


volatile uint8_t sendBuffer[I2C_MSG_OUT_SIZE];

void setup()
{
  Wire.begin(0x7f);
  Wire.onReceive(receiveEvent);
  Wire.onRequest(requestEvent);
  Serial.begin(9600);
  pinMode(omhoog, INPUT); 
  pinMode(omlaag, INPUT); 

// set up pins
  pinMode(DETECT, INPUT);     //zero cross detect
  digitalWrite(DETECT, HIGH); //enable pull-up resistor
  pinMode(GATE, OUTPUT);      //TRIAC gate control

  // set up Timer1 
  //(see ATMEGA 328 data sheet pg 134 for more details)
  OCR1A = 100;      //initialize the comparator
  TIMSK1 = 0x03;    //enable comparator A and overflow interrupts
  TCCR1A = 0x00;    //timer control registers set for
  TCCR1B = 0x00;    //normal operation, timer disabled

  attachInterrupt(0,zeroCrossingInterrupt, RISING);    
 
}

void zeroCrossingInterrupt(){ //zero cross detect   
  TCCR1B=0x04; //start timer with divide by 256 input
  TCNT1 = 0;   //reset timer - count from zero
}

ISR(TIMER1_COMPA_vect){ //comparator match
  digitalWrite(GATE,HIGH);  //set TRIAC gate to high
  TCNT1 = 65536-PULSE;      //trigger pulse width
}

ISR(TIMER1_OVF_vect){ //timer1 overflow
  digitalWrite(GATE,LOW); //turn off TRIAC gate
  TCCR1B = 0x00;          //disable timer stopd unintended triggers
}


void loop() {

Difference = round(UpperLimit / LowerLimit);

if (Meek>=0 && Meek<=100) {
  Domoticz = Meek;
}

if (Meek>=LowerLimit && Meek<=UpperLimit) {
  Domoticz1 = map(OCR1A , LowerLimit, UpperLimit, 0 , 100);
}

if (Meek>=1 && Meek<=100) {
OCR1A =map(Meek,1,100, LowerLimit,UpperLimit);
}

if (Meek>=1 && Meek<=100) {
  OCR1A =map(Meek,1,100, LowerLimit,UpperLimit);
}


if (Meek>=LowerLimit && Meek<=UpperLimit && Difference > (Domoticz-Domoticz1)) {
  Domoticz = Domoticz1;
}

  
if (Meek>=LowerLimit && Meek<=UpperLimit) {  
OCR1A = Meek;     }



if (Meek>=1500 && Meek<=1599){
  StepDown=(Meek-1500);} 
if (Meek>=1500 && Meek<=1599){
  StepDown=(Meek-1500);} 
if (Meek>=1600 && Meek<=1699){
  StepUp=(Meek-1600);} 
if (Meek>=1700 && Meek<=1799){
  InputDelay=(Meek-1700);}   
if (Meek>=1800 && Meek<=1899 && OCR1A>150 && OCR1A<=603 ){
  OCR1A=(OCR1A-(Meek-1800));} 
if (Meek>=1900 && Meek<=1999 && OCR1A>=150 && OCR1A<603 ){
  OCR1A=(OCR1A+(Meek-1900));} 
if (Meek==2000 && OCR1A>=150 && OCR1A<=603){
  OCR1A=(OCR1A+1);} 
if (Meek==2000 && OCR1A==604){
  OCR1A=(0);} 
if (Meek==2001 && OCR1A==0){
  OCR1A=(605);} 
if (Meek==2001 && OCR1A<=603 && OCR1A>=150){
  OCR1A=(OCR1A-1);} 

if (OCR1A>UpperLimit) {
OCR1A=UpperLimit;}

if (OCR1A>0 && OCR1A<=LowerLimit) {
OCR1A=LowerLimit;}


Serial.print("Meek = ");  
Serial.print(Meek);
Serial.print("OCR1A = ");  
Serial.print(OCR1A);
Serial.print("domoticz =");
Serial.print(Domoticz); 
Serial.print("Difference =");
Serial.print(Difference); 
Serial.print("Domoticz11111 =");
Serial.print(Domoticz1); 
delay(1000);
Serial.print('\n');



int hoog = digitalRead (omhoog);
if (hoog == 1 ){
  OCR1A=(OCR1A+1) ;

    
}


int laag = digitalRead (omlaag);
if (laag == 1 ){
  OCR1A=(OCR1A-1);
}


        
delay(InputDelay); 
  }

void receiveEvent(int count)
{
  if (count == I2C_MSG_IN_SIZE)
  {
    byte cmd = Wire.read();
    byte port = Wire.read();
    int value = Wire.read();
    value += Wire.read()*256;
    switch(cmd)
      {
        case CMD_DIGITAL_WRITE:
          pinMode(port,OUTPUT);
          digitalWrite(port,value);
          break;
        case CMD_DIGITAL_READ:
          pinMode(port,INPUT_PULLUP);
          clearSendBuffer();
          sendBuffer[0] = digitalRead(port);
          break;
        case CMD_ANALOG_WRITE:
          //analogWrite(port,value);
          Meek=(value);
          break;
        case CMD_ANALOG_READ:
          clearSendBuffer();
          int valueRead = Domoticz;
          sendBuffer[0] = valueRead & 0xff;
          sendBuffer[1] = valueRead >> 8;
          break;
      }
  }
}

void clearSendBuffer()
{
  for(byte x=0; x < sizeof(sendBuffer); x++)
    sendBuffer[x]=0;
}

void requestEvent()
{
  Wire.write((const uint8_t*)sendBuffer,sizeof(sendBuffer));
}



User avatar
Eddiever
Posts: 105
Joined: Thursday 27 April 2017 20:32
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: The Netherlands (Hoogeveen)
Contact:

Re: Meek Wifi Wall Switch

Post by Eddiever »

Meek: this looks darn good! I did subscribe to your youtube channel. I hope your products will become available any time soon because my Sonoff Touch has let me down two times allready. Keep up the good work and if your products are available please let me know. I will order some!
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests