seydx / homebridge-washingmachine-pow

Dynamic Homebridge Platform plugin for Sonoff POW customized for washingmachines
19 stars 3 forks source link

Extent for more MQTT device #9

Closed MAPEZ1 closed 3 years ago

MAPEZ1 commented 3 years ago

pow-wow... exactly what I was looking for :-) Looking into, I noticed that it's even MQTT and I thought I try it with an Shelly2.5 (kW ok) as I still have one. I'm not a programmer, but I tried to tweak (with sons help) the topics in the config with no luck :-(

example to remove digits

"topics": {
                        "energyGet": {
                            "topic": "shellies/shellyswitch25-68C63AF90107/relay/0/power",
                            "apply": "return Math.round(message);"
                        }

This did at least not produce errors and crash HB, but no values in EveApp either Do you think there is any chance to get it compatible also with Shelly ? Thanks a lot in advance for answer...

full error text

[2/22/2021, 12:58:28 PM] [WMPow] WashMach.: 122.76 (energyGet)
[2/22/2021, 12:58:28 PM] TypeError: Cannot read property 'Power' of undefined
at MqttClient.<anonymous> (/usr/local/lib/node_modules/homebridge-washingmachine-pow/src/accessories/outlet.js:168:34)
at MqttClient.emit (events.js:315:20)
at MqttClient._handlePublish (/usr/local/lib/node_modules/homebridge-washingmachine-pow/node_modules/mqtt/lib/client.js:1277:12)
at MqttClient._handlePacket (/usr/local/lib/node_modules/homebridge-washingmachine-pow/node_modules/mqtt/lib/client.js:410:12)
at work (/usr/local/lib/node_modules/homebridge-washingmachine-pow/node_modules/mqtt/lib/client.js:321:12)
at Writable.writable._write (/usr/local/lib/node_modules/homebridge-washingmachine-pow/node_modules/mqtt/lib/client.js:335:5)
at doWrite (/usr/local/lib/node_modules/homebridge-washingmachine-pow/node_modules/readable-stream/lib/_stream_writable.js:409:139)
at writeOrBuffer (/usr/local/lib/node_modules/homebridge-washingmachine-pow/node_modules/readable-stream/lib/_stream_writable.js:398:5)
at Writable.write (/usr/local/lib/node_modules/homebridge-washingmachine-pow/node_modules/readable-stream/lib/_stream_writable.js:307:11)
at Socket.ondata (_stream_readable.js:716:22)
[2/22/2021, 12:58:28 PM] Got SIGTERM, shutting down Homebridge...
seydx commented 3 years ago

Does the Shelly run via Tasmota?

MAPEZ1 commented 3 years ago

Hi, No, not on Tasmota. Shelly firmware v1.9.4 with MQTT enabled which provides these topics to read and set output channels 0 and 1 : shellies//relay/ for each relay ; reports status: on, off or overpower shellies//relay//command for each relay ; accepts on, off or toggle Energy measures for each channel: shellies//relay//power for each relay ; reports instantaneous power consumption rate in Watts shellies//relay//energy for each relay ; reports amount of energy consumed in Watt-minute shellies//relay//overpower_value for each relay reports the value in Watts, on which an overpower condition is detected

There is no energy reset but it provides three counters and a total: "counters":[0.000, 0.000, 0.000],"total":0}]

Need to say that the shelly 2.5 takes 2300 watt max before it switches to overpower. Mine with 2000 watt would just work.

seydx commented 3 years ago

@MAPEZ1

the plugin is designed to run with tasmota firmware

MAPEZ1 commented 3 years ago

Oh man 🤦🏼‍♂️ for whatever reason never thought about flash the shelly.... possibly because of the Sonoff icon 🤷🏼‍♂️ Thanx for enlighten me 😊