alexryd / node-shellies Goto Github PK
View Code? Open in Web Editor NEWHandles communication with Shelly devices
License: MIT License
Handles communication with Shelly devices
License: MIT License
Feature: add voltage as prop for battery powered devices.
I'm trying to execute the cli inside a docker container, but unfortunately, no devices are discovered. Native execution directly in the host works perfectly.
I've tried using with and without the host network for the container. I'm using a MAC, so maybe there are limitations on docker networking and the multicast addr
Any clue?
Keep up this good work!
FROM node:12.16.1-stretch
RUN npm i -g shellies
ENTRYPOINT ["shellies"]
CMD ["listen"]
docker build -t shellies .
# check is working
docker run --network=host shellies --help
node-shellies 1.1.1
Valid commands: listen, description, status
docker run --network=host shellies listen
# ..... anything found
Hey @alexryd !
Just let you know that I've released https://github.com/jmendiara/coiot-coap to handle coap requests with shelly devices, and maybe you are interested in it to reduce boilerplate here.
You have inspired some of the work done for this lib, so thank you very much!
Would be great to start supporting new products like the Shelly 1 Plus
The Shelly EM also reports the reactive power. Is this also available under the coap protocol and if so, could this be added to the shellies library?
Hi, sorry I'm new to homebridge and node-shellies.
I tried patching in the network address, since the command does not accept one, to no avail.
This is in a homebridge container, as you probably have already guessed...
Homebridge Terminal
Node.js Version: v18.13.0
Node.js Path: /opt/homebridge/bin/node
Plugin Path: /var/lib/homebridge/node_modules
Update Node.js: hb-service update-node
Install Plugin: hb-service add homebridge-plugin-name
Remove Plugin: hb-service remove homebridge-plugin-name
root@8d20211fd812:/homebridge $ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.2.253 netmask 255.255.255.0 broadcast 192.168.2.255
ether 7c:05:07:0d:cf:5f txqueuelen 0 (Ethernet)
RX packets 4744 bytes 1135426 (1.1 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 755 bytes 5425882 (5.4 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 1000 (Local Loopback)
RX packets 288 bytes 62104 (62.1 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 288 bytes 62104 (62.1 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
root@8d20211fd812:/homebridge $ shellies listen
^C
root@8d20211fd812:/homebridge $ tcpdump -A udp port 5683
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
18:02:04.449729 IP 192.168.5.15.5683 > 224.0.1.187.5683: UDP, length 142
E....................3.3...*P.
..cit.s....SHHT-1#007BCC#2.C......{"G":[[0,9103,0],[0,3101,19.50],[0,3102,67.10],[0,3103,73.0],[0,3115,0],[0,3111,98],[0,9102,["sensor"]]]}
18:02:07.279346 IP shellyplug-s-7C87CEB482A9.5683 > 224.0.1.187.5683: UDP, length 169
E...I.....I....7.....3.3....P....cit.s... SHPLG-S#7C87CEB482A9#2.C......{"G":[[0,9103,2],[0,1101,1],[0,4101,59.39],[0,4103,76704],[0,6102,0],[0,6109,0.00],[0,3104,27.38],[0,3105,81.28],[0,6101,0]]}
18:02:09.782947 IP shellyplug-s-7C87CEB4A491.5683 > 224.0.1.187.5683: UDP, length 168
E.........
....2.....3.3....P..V.cit.s... SHPLG-S#7C87CEB4A491#2.C......{"G":[[0,9103,1],[0,1101,1],[0,4101,0.00],[0,4103,97417],[0,6102,0],[0,6109,0.00],[0,3104,27.32],[0,3105,81.17],[0,6101,0]]}
18:02:10.443694 IP shellyplug-s-7C87CEB4828E.5683 > 224.0.1.187.5683: UDP, length 168
E..............3.....3.3....P.]..cit.s... SHPLG-S#7C87CEB4828E#2.C......{"G":[[0,9103,0],[0,1101,1],[0,4101,0.00],[0,4103,34799],[0,6102,0],[0,6109,0.00],[0,3104,23.80],[0,3105,74.85],[0,6101,0]]}
18:02:12.958574 IP shelly1-485519C93822.5683 > 224.0.1.187.5683: UDP, length 106
E......... Y...+.....3.3.r).P..9.cit.s....SHSW-1#485519C93822#2.C......{"G":[[0,9103,0],[0,1101,0],[0,2101,0],[0,2102,""],[0,2103,2]]}
18:02:13.710151 IP 192.168.5.17.5683 > 224.0.1.187.5683: UDP, length 143
E....................3.3..k.P..y.cit.s....SHHT-1#008AF1#2.C......{"G":[[0,9103,0],[0,3101,20.38],[0,3102,68.68],[0,3103,57.5],[0,3115,0],[0,3111,100],[0,9102,["sensor"]]]}
18:02:13.875020 IP shellyplug-s-7C87CEB50DB5.5683 > 224.0.1.187.5683: UDP, length 169
E....|.........1.....3.3....P..n.cit.s... SHPLG-S#7C87CEB50DB5#2.C......{"G":[[0,9103,1],[0,1101,1],[0,4101,3.43],[0,4103,238441],[0,6102,0],[0,6109,0.00],[0,3104,31.05],[0,3105,87.88],[0,6101,0]]}
18:02:13.982021 IP shelly1-485519CA3F31.5683 > 224.0.1.187.5683: UDP, length 106
E.........}..........3.3.r!VP....cit.s....SHSW-1#485519CA3F31#2.C......{"G":[[0,9103,0],[0,1101,0],[0,2101,0],[0,2102,""],[0,2103,0]]}
18:02:15.106786 IP shellyuni-98CDAC2B94B0.5683 > 224.0.1.187.5683: UDP, length 166
E..............*.....3.3..h;P....cit.s... SHUNI-1#98CDAC2B94B0#2.C......{"G":[[0,9103,0],[0,1101,0],[0,1201,0],[0,2101,0],[0,2102,""],[0,2103,0],[0,2201,0],[0,2202,""],[0,2203,0],[0,3118,0.06]]}
18:02:16.213909 IP shellyplug-s-7C87CEB50DB5.5683 > 224.0.1.187.5683: UDP, length 169
E....~.........1.....3.3....P..o.cit.s... SHPLG-S#7C87CEB50DB5#2.C......{"G":[[0,9103,1],[0,1101,1],[0,4101,3.46],[0,4103,238441],[0,6102,0],[0,6109,0.00],[0,3104,30.82],[0,3105,87.48],[0,6101,0]]}
^C
10 packets captured
10 packets received by filter
0 packets dropped by kernel
root@8d20211fd812:/homebridge $
Trying to understand this message and how to fix it.
Wrong repo ๐
@alexryd can you update us on the status of this project? It's been over a year since anything was done and there are merged changes that have not been published.
The Shelly4Pro also measure the total power usage per channel. Is it available under the coap protocol and if so, could this be added to the shellies library?
I have several motion sensors 1 on firmware v2.0.5@3f0fcbbe
where status updates are not getting parsed correctly by the shellies library.
device.type is SHMOS-01
Prop is payload
oldValue is [[0,6107,1],[0,3119,1654287358],[0,3120,1],[0,6110,0],[0,3106,11],[0,3111,98],[0,9103,0]]
newValue is [[0,6107,0],[0,3119,1654287358],[0,3120,1],[0,6110,0],[0,3106,11],[0,3111,98],[0,9103,0]]
What could be causing this?
The device is discovered as SHMOS-01
which has a valid device class. Yet it seems to be parsed as an unknown device.
/cit/d
from the device is:
"blk": [
{
"I": 1,
"D": "sensor_0"
},
{
"I": 2,
"D": "device"
}
],
"sen": [
{
"I": 6107,
"T": "A",
"D": "motion",
"R": [
"0/1",
"-1"
],
"L": 1
},
{
"I": 3119,
"T": "S",
"D": "timestamp",
"U": "s",
"R": [
"U32",
"-1"
],
"L": 1
},
{
"I": 3120,
"T": "A",
"D": "motionActive",
"R": [
"0/1",
"-1"
],
"L": 1
},
{
"I": 6110,
"T": "A",
"D": "vibration",
"R": [
"0/1",
"-1"
],
"L": 1
},
{
"I": 3106,
"T": "L",
"D": "luminosity",
"R": [
"U32",
"-1"
],
"L": 1
},
{
"I": 3111,
"T": "B",
"D": "battery",
"R": [
"0/100",
"-1"
],
"L": 2
},
{
"I": 9103,
"T": "EVC",
"D": "cfgChanged",
"R": "U16",
"L": 2
}
]
}```
First, the package is working very well.
I'm now using the Shellie Duo Bulb and am getting the message
payload Changed from [[0,111,1073740964]] to [[0,111,1073741012]]
I presume that it's a matter of adding the new device and codes to a table. Where do I find out what the numbers mean? Is there a mechanism for adding new devices without modifying the source code and submitting a new version?
If I were to create a PR that converts the project to typescript, would you consider merging it?
I'm making the type definition now for my own project, but I bet other people would like typing too.
Allterco Robotics might support CoIoT over unicast for Shelly devices in the near future. It will be made configurable in the device settings. What is needed to support unicast using this library?
Basically the CoAP server needs to use 0.0.0.0 as binding address and 224.0.1.187 as IP_ADD_MEMBERSHIP address to support both multicast and unicast.
Nice library. Will probably be using this to integrate Shelly devices with the Homey domotica controller. I have a request though.
Currently the Shelly RGBW2 and Shelly Bulb report color changes with individual reports for each R, G and B values. Is it possible to receive only one status change when the color changes containing all values for red, green and blue channel at once?
I am using sbender9/signalk-shelly to read the status of my Shelly UNI in Signal K. This plugin uses node-shellies to connect to Shelly devices.
Setup:
Signal K version 2.2.0
signalk-shelly version 1.15.0
Shelly UNI running latest firmware
Issue: shellies via Signal K looses contact to Shelly UNI over the time, no updates coming in
Description:
This behavior is 100% reproducible in my system.
As there is no obvious reason in [sbender9/signalk-shelly] (https://github.com/sbender9/signalk-shelly), I assume the issue might reside in node-shellies.
Hey,
Thank you for this package and for homebridge-shelly
package.
I am trying to run shellies listen
on my mac server running homebridge and nothing happens.
When I try running it on another mac on the same network I get responses.
Any suggestions?
Hi
In my Project the Offline will not be emitted.
I used it like in the description:
device.on('offline', () => { // the device went offline console.log('Device with ID', device.id, 'went offline') })
i also used:
this.shellies.staleTimeout = 1000;
also with tifferend times, but it never emitted..
Maybe someone could give me a hint, why.. i could if you wna't also give more info about the project. The change and discover emitt as normal..
(Sorry for the english, not native)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.