Jan200101 / ShellyPy

Python library to interact with Shelly devices
MIT License
22 stars 14 forks source link

deviceMeter = device.meter(0) #request meter information #17

Open Amadexd opened 10 months ago

Amadexd commented 10 months ago

Code: import ShellyPy

device = ShellyPy.Shelly("192.168.100.33")

deviceMeter = device.status() #request meter information print(deviceMeter[0]) #print power information print(deviceMeter['total']) #print total informatio print(deviceMeter)

Result /bin/python3.12 /home/ubudesa/py/pp_shelly.py Traceback (most recent call last): File "/home/ubudesa/py/pp_shelly.py", line 5, in deviceMeter = device.meter(0) #request meter information ^^^^^^^^^^^^^^^ File "/home/ubudesa/.local/lib/python3.12/site-packages/ShellyPy/gen2.py", line 97, in meter raise NotImplementedError("Unavailable") NotImplementedError: Unavailable

I can't find the error install pip install ShellyPy, when I run it I see the error, can you help me please?

Amadexd commented 10 months ago

it is installed

pip list

python-dateutil 2.8.1 python-debian 0.1.43+ubuntu1.1 pytz 2022.1 pyxdg 0.27 PyYAML 5.4.1 reportlab 3.6.8 requests 2.25.1 SecretStorage 3.3.1 setuptools 69.0.3 ShellyPy 0.3.0 six 1.16.0 ssh-import-id 5.11 systemd-python 234 ubuntu-advantage-tools 8001 ubuntu-drivers-common 0.0.0 ufw 0.36.1 unattended-upgrades 0.1 urllib3 1.26.5 usb-creator 0.3.7 wadllib 1.3.6 wheel 0.42.0 xdg 5 xkit 0.0.0 zipp 1.0.0

geblerg commented 7 months ago

meter() and emeter() are not implemented (yet) for gen 2 devices. I would also need meter() to work with gen 2 devices (Shelly Plug S in this case). Is it planned to implement this in the near future?

But thanks for your work you have done so far!