Are Meross switches compatible with any existing components?

Hi,

The mqtt discovery Is useful to automatically add sensors and switch in the UI. I found it very easy.

Otherwise you have to map manually every single sensors and switch in your config file. Remember, every single plug is at least a plug and maybe a sensor.


1 Like

I have this problem

[email protected] start /usr/src/hassio_meross
node app.js
Error: 1004: A
at Request.request [as _callback] (/usr/src/hassio_meross/node_modules/meross-cloud/index.js:92:45)
at Request.self.callback (/usr/src/hassio_meross/node_modules/request/request.js:185:22)
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request. (/usr/src/hassio_meross/node_modules/request/request.js:1161:10)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at IncomingMessage. (/usr/src/hassio_meross/node_modules/request/request.js:1083:12)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:111:20)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node app.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-01-07T12_05_05_890Z-debug.log

Iā€™ve tried to map one switch this way:

  - platform: mqtt
    name: "Merossfiltro"
    state_topic: "homeassistant/switch/18050341434354251a0234298f1176ea_0/state"
    command_topic: "homeassistant/switch/18050341434354251a0234298f1176ea_0/command"
    value_template: "{{value_json.state}}"
    payload_on: "1"
    payload_off: "0"
    state_on: "1"
    state_off: "0"
    optimistic: false
    qos: 0
    retain: true

And added switch.Merossfiltro to my group. I see it in the UI, but when I use it i get this (in addon log) and nothing happens::

Device 18050341434354251a0234298f1176ea recive a command 1

Also if I try to change the state via Meross app on my phone, log is:

Unsupported ability Appliance.Control.Toggle for the divice 18050341434354251a0234298f1176ea.
{ toggle: { onoff: 1, lmTime: 1546862697 } }

Help please! :sweat_smile:

Hi,

are you use the addons, a custom docker or directly from node?
Wich version of node/npm are u using? have u lunch npm befor?

hi,

so u choise to use the addons, but to manually add the sensor/switch, right?

Wich meross device are u using?

I ask you to do a little test:

  • Disable mqtt (and if you have persistence, remove al retained message)
  • Disable addons
  • Restart mqtt
  • Enable addons

I haveā€™t test the script without the autodiscovery, so for me is an undocumentated procedure.

Also, I donā€™t have implemented all meross ability, but ToogleX are implemented. I need the device name for this reason. In my test, with the devices I have, the ability Toggle was not used and donā€™t work. Some times arrive from meross api some ability who I think is not necessary for nowā€¦ butā€¦you knowā€¦maybe i miss something.

let me know

I have two MSS310 and two MSS425e. My system is Hassio on Pi3.
Iā€™ve done disabling-enabling, but nothing change

PS : Could you publish your mqtt discovery string for one of your Meross?

Iā€™ve tested MQTT discovery and it seems working with Mosquitto.

  • The two multiswitches MSS425e work but they doesnā€™t autoupdate the initial status of the switches
  • I can also discover the two MS310 (also without autoupdate initial status), but when I switch on it returns off after 2 seconds without setting the switch

Hi,
this is my mqtt config mqtt discovery message for a single device.

{"name":"Tv","command_topic":"homeassistant/switch/12312312312413412341234123423_0/command","state_topic":"homeassistant/switch/12312312312413412341234123423_0/state","value_template":"{{value_json.state}}","payload_on":"1","payload_off":"0","state_on":"1","state_off":"0","unique_id":"12312312312413412341234123423_0","device":{"name":"Tv","model":"mss310h","sw_version":"2.1.5","identifiers":["12312312312413412341234123423"]},"retain":true}

Sorry for this bug :frowning:
I try to fix the code as soon as I have free time.

In any case, feel free to help me to improve the code if you want.

Iā€™m not a ā€œskilledā€ developer, so all I can do is read your code and understand how it work.
Iā€™ve found only an aesthetic ā€œerrorā€,app.js - line 96: ā€œdiviceā€ is ā€œdeviceā€

Hi Carlo, I used your custom component, set it up correctly, after starting it I see the 2 Meross plug I have are correctly discovered but I donā€™t see the relevant switch in the Main HA interface nor I do see the 2 plugs into the entity list.
Iā€™ve mqtt_discovery = true, the mqtt messages are correctly sent (I checked with mqttspy) but I have no idea how to make them show into the GUI in order to be able to use them as regular switches in HA.
can you please help to understand what Iā€™m doing wrong?
grazie!

@papperone
Look in menu ā€œconfigurationā€, then ā€œIntegrationsā€, here youā€™ll find MQTT: configuration.yalm with some icons simbolizing your plugs, click on one of this and the new page will show you all switches, with their name. Use this in your configuration/switches

thanks but I already checked and I see no icons in the MQTT integration :frowning:

PS: Iā€™m using mosquitto addon with SSL security enabled, is this requiring additional setup?

PS: Iā€™m using mosquitto addon with SSL security enabled, is this requiring additional setup?
I donā€™t use SSL, this is my simple MQTT configuration, nothing more, nothing less:

mqtt

mqtt:
discovery: true
discovery_prefix: homeassistant
broker: core-mosquitto
keepalive: 60
username: xxxxx
password: xxxxx

@gianky69 I use a mosquitto broker which I cannot changeā€¦
I will do further test later today once Iā€™m back homeā€¦

After removing and adding back the MQTT integration I succeed to see the 2 smartplugs (some additional issues created by the fact I renamed one of those but solvedā€¦)ā€¦
Now all seems to work on as I can see both plugs power data (they are both MSS310) but I cannot operate them from HA :frowning:
Iā€™ve always this message:
"Unsupported ability Appliance.Control.Toggle for the divice 1801305819598725131034298f1147df "
And of course I cannot see the status on/off when I toggle them from the mobile appā€¦
Can anyone help here now?

Hi folks,

the errors u have (the missing switch) is similar to a kind error I see on sonoff tasmota device. So, now iā€™m looking to their solution.

@papperone The addons support SSL and I have tested it with cloudmqtt. The URL can be on the following protocols: ā€˜mqttā€™, ā€˜mqttsā€™, ā€˜tcpā€™, ā€˜tlsā€™, ā€˜wsā€™, ā€˜wssā€™.
Usually when I have generic error I do the following steps:

  • Disable mqtt (and if you have persistence, remove al retained message)
  • Disable addons
  • Restart mqtt
  • Enable addons

The weird thing is I have MSS310 too and for me the command Toggle is never called.

I tried already to disable mqtt, delete messages, and restart as you suggested without any successā€¦
all works but the switch function and I did nothign special, itā€™s HA that calls the ā€œtoggleā€ whenever I click on the switch and then the errorā€¦ as the message has a spelling error I searched and it seems to be generated by your code, so now the interesting portion is ā€œwhy my HA invoke the toggle commands while yours notā€!

PS: to have a test which MQTT topic shoudl I manually send to turn on or off the Meross switch?
PPS: are you using auto-discovery or manual definition of the mqtt switch? if so can you please post your code?

just forgotā€¦
can you please check which meross firmware are you using (I have 1.1.18) and which hassio version?

I have tested it on discovery mode.
To test it manually try to send a message at the topic homeassistant/switch/deviceid_0/command with payload 1 (replace deviceid with a valid value)

I think this weekend I can implement Toogle ability, probably ā€œblindā€ becouse my same device work differently.

I was also thinking to move the code from addon to an home assistant components, but I donā€™t think any time soon.

Be patient, I do it all ASAP