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.
[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
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.
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
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
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:
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
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?
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?
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.