Meross wi-fi Plug

Others (MiLight, Hue, Toon etc...)

Moderator: leecollings

mangoose
Posts: 10
Joined: Saturday 18 November 2017 8:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10x
Location: France
Contact:

Re: Meross wi-fi Plug

Post by mangoose »

Hi,

You can put the code anywhere.
You need to set the Meross credentials in the config.json file as well as the mqtt and domoticz server information.

In domoticz, you need create a dummy device with a Light Switch with the On/Off Type and put the id you will get from the logs of the script in the description of this dummy. You need to create another dummy device for the energy with a General type (you need to set the Energy Read to computed).
and also put the id in the description.

For testing purpose you can run is with npx: 'npx ./meross2domoticz.js'
For a regular usage, you need to run it with pm2 with ' pm2 start meross2domoticz.js'

Hope it helps.
RPI3 + DIY Rflink + RF433 + Meross devices + ESP8266 devices (Sonoff + DIY) + Kodi + GoogleHome
jluc2808
Posts: 49
Joined: Thursday 18 January 2018 6:30
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Meross wi-fi Plug

Post by jluc2808 »

ok thanks

i see this require mqtt to run, does it require websocket or just http with MQTT ?
could the code be installed and run on another machin than the domoticz one ?
mangoose
Posts: 10
Joined: Saturday 18 November 2017 8:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10x
Location: France
Contact:

Re: Meross wi-fi Plug

Post by mangoose »

Hi,

You just need a mqtt broker and connect Domoticz to MQTT using the "MQTT Client Gateway with LAN interface" hardware. It will be used to transfer information between domoticz and my script.

I never tested to run the script on another server, but it should work since you can give the location of the mqqt and domoticz servers.

Pierre
RPI3 + DIY Rflink + RF433 + Meross devices + ESP8266 devices (Sonoff + DIY) + Kodi + GoogleHome
Bigted
Posts: 68
Joined: Friday 12 December 2014 14:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Contact:

Re: Meross wi-fi Plug

Post by Bigted »

Getting a crash at switching or reading the energy consumption

Sending state to Meross
18121193618636221a1034298f13c72a data: "Appliance.Control.ToggleX"
/home/pi/node_modules/meross-cloud/index.js:252
this.emit('close', error.toString());
^

TypeError: Cannot read property 'toString' of undefined

Posted the full log on your github page
mangoose
Posts: 10
Joined: Saturday 18 November 2017 8:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10x
Location: France
Contact:

Re: Meross wi-fi Plug

Post by mangoose »

Hi,

I made some changes in the code but I am not sure this will work since I never had this message.
Let me know if it fixes the problem.

Pierre
RPI3 + DIY Rflink + RF433 + Meross devices + ESP8266 devices (Sonoff + DIY) + Kodi + GoogleHome
Bigted
Posts: 68
Joined: Friday 12 December 2014 14:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Contact:

Re: Meross wi-fi Plug

Post by Bigted »

Consumption now reporting and doesn't crash however toggling the plug from either Domoticz or the Meross app still crashes it
Bigted
Posts: 68
Joined: Friday 12 December 2014 14:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Contact:

Re: Meross wi-fi Plug

Post by Bigted »

Looks like there is an issue with the meross-cloud module, depending on which firmware version of the Meross 310 you have it will work or not
mangoose
Posts: 10
Joined: Saturday 18 November 2017 8:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10x
Location: France
Contact:

Re: Meross wi-fi Plug

Post by mangoose »

Hi,

That is what I think depsite the fact that I have the same version as you. The only difference is that I have the french subtype and you have the uk subtype.

P
RPI3 + DIY Rflink + RF433 + Meross devices + ESP8266 devices (Sonoff + DIY) + Kodi + GoogleHome
Bigted
Posts: 68
Joined: Friday 12 December 2014 14:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Contact:

Re: Meross wi-fi Plug

Post by Bigted »

If i HACK meross-cloud/index.js and remove the error reporting around

this.devices[dev.uuid].on('close', (error) => {
this.emit('close', dev.uuid, error);

then the plug turns off and on from the app and Domoticz, I get an undefined message but your plugin continues to function
mangoose
Posts: 10
Joined: Saturday 18 November 2017 8:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10x
Location: France
Contact:

Re: Meross wi-fi Plug

Post by mangoose »

Good news.
RPI3 + DIY Rflink + RF433 + Meross devices + ESP8266 devices (Sonoff + DIY) + Kodi + GoogleHome
mangoose
Posts: 10
Joined: Saturday 18 November 2017 8:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10x
Location: France
Contact:

Re: Meross wi-fi Plug

Post by mangoose »

Hi,

I added the abilty to automaticaly create the Energy & Switch devices in Domoticz without anything to do.
Of course, it will do it only once.

Hope it will help you to use it.

Pierre
Last edited by mangoose on Friday 26 April 2019 16:29, edited 1 time in total.
RPI3 + DIY Rflink + RF433 + Meross devices + ESP8266 devices (Sonoff + DIY) + Kodi + GoogleHome
Bigted
Posts: 68
Joined: Friday 12 December 2014 14:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Contact:

Re: Meross wi-fi Plug

Post by Bigted »

Recent updates working really well, makes it a lot easier, any news on the MSS425
mangoose
Posts: 10
Joined: Saturday 18 November 2017 8:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10x
Location: France
Contact:

Re: Meross wi-fi Plug

Post by mangoose »

Hi,

I do not have a MSS425 so I do not know how it reacts and how to control it. If I can convince my wife to buy one, I may be able to update the code to handle it.

-P-
RPI3 + DIY Rflink + RF433 + Meross devices + ESP8266 devices (Sonoff + DIY) + Kodi + GoogleHome
mangoose
Posts: 10
Joined: Saturday 18 November 2017 8:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10x
Location: France
Contact:

Re: Meross wi-fi Plug

Post by mangoose »

Hi,

I finaly got a MSS425 and change the script to support it. It seems to fully work. As usual, it creates all the devices for you.

Since the system need the channel of the devices, you need either to delete your previous switch and let the script recreate them or edit the switch by adding |0 at the end of the uuid. I think that the first method is the best.

I hope it will help you.

P
RPI3 + DIY Rflink + RF433 + Meross devices + ESP8266 devices (Sonoff + DIY) + Kodi + GoogleHome
Bigted
Posts: 68
Joined: Friday 12 December 2014 14:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Contact:

Re: Meross wi-fi Plug

Post by Bigted »

Thanks for the update, both the MSS310 and the MSS425 working well
mangoose
Posts: 10
Joined: Saturday 18 November 2017 8:37
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10x
Location: France
Contact:

Re: Meross wi-fi Plug

Post by mangoose »

Good news!
RPI3 + DIY Rflink + RF433 + Meross devices + ESP8266 devices (Sonoff + DIY) + Kodi + GoogleHome
smotx
Posts: 2
Joined: Tuesday 02 October 2018 10:56
Target OS: -
Domoticz version:
Contact:

Re: Meross wi-fi Plug

Post by smotx »

Sorry, my english is not verry well and i don't understand how to use Magoose Script.

Settings on config.json is ok

I have created de 'dummies', IDX 371 and now ? how to use the "371" ?

Thxs for help.
XenoMorpH
Posts: 1
Joined: Tuesday 17 March 2020 23:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Meross wi-fi Plug

Post by XenoMorpH »

I know this is an old post, but is there a complete step by step tutorial on how to set this up?
I am trying to get it to work but without any luck.

Edit:
Got it working :). I had to let it run on pyhton3 and not python.

Btw, is there a way to read out the Total consumption (like in the android app).
philips
Posts: 12
Joined: Friday 07 February 2020 15:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Poland
Contact:

Re: Meross wi-fi Plug

Post by philips »

XenoMorpH wrote: Wednesday 18 March 2020 0:20 Got it working :). I had to let it run on pyhton3 and not python.
Could You pleeease share info on how did you make it run ?
What I did already is :
Download the bridge to /home/pi

Code: Select all

git clone https://github.com/mangoose002/Meross2Domoticz
go into the foder of the bridge:

Code: Select all

cd Meross2Domoticz
edit the config.json

Code: Select all

sudo nano config.json
My Domoticz is running on localhost :8080 and my mqtt also on localhost:1883 so left default.

Questions:
1. I'm not sure what if I have my Domoticz use a user and password and the same with with MQTT secured by a username and password ? Should I make any changes to the config.json with user & passwords ?
2. After filling the config.json how do I should run the bridge now ?
3. Should I make the files executable ?
4. How to choose which python should it work on ?
Raspberry Pi 4 2GB
RobT
Posts: 1
Joined: Thursday 15 October 2020 19:53
Target OS: -
Domoticz version:
Contact:

Re: Meross wi-fi Plug

Post by RobT »

I spent a lot of time activating this wifi meross plug, now I'm going to switch to another home automation easier to install and with a lot of plugins already installed.
This home automation needs more development, it becomes very poor in terms of ready plugins.
Until now I was using IFTTT to run my meross but now that we need to pay for IFTTT, I have to find another solution.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests