-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error running script #130
Comments
Same error (firmware 3.4.1): A thing if device is not reporting
|
My error log indicates Zeroconf as the source of the issue so I downgraded Zeroconf to 0.26.1 from 0.27.1 and now everything is fine. Hope it helps. |
For those unsure how to downgrade, I had success with the following: |
Hi everyone, error : Missing api_key for encrypted device Any idea on how to fix that ? Thanks for your help |
About zeroconf, when installing from pypi it downloads an old version of requirements and it doesn't work. Maybe it would be a good a idea make a 'release' to get the program working without having to downgrade zeroconf? About missing api_key, you need to kwnow your api. An easy way is to put the sonoff in 'pairing' mode and to connect to http://10.10.7.1/device ... You'll get some parameters needed to run pysonofflanr3, which you can pass as command arguments. |
Thanks @fernand0 ! Works great through command line. I'm now trying to use the python3 library and I manage to use the code provided in the the Readme.rst. However when I try to call the turn_on function, it doesn't seem to work... Here's my code:
Any idea on what I'm doing wrong ? Thanks for your help. Matt |
I'm not familiar with asyncio but it seems to me that you are not making a call. Just in case it is of use for you, here you have my own code:
|
Hi @fernand0 , Thanks for your code. I managed to make it work with your code ! In the first place I wanted to create an instance of SonoffSwitch and then use its functions to turn it on or off instead of calling the cli.switch_device() with the configuration of the SonoffSwitch as an argument. But I guess I'm not expert enough in Python to understand how to do so. Thanks again for your help. Best regards, Matt |
Have any information - how and where to obtain api_key ? |
Hello, you can obtain your parameters, for example, setting the device in pairing mode and then, you can connect to the access point of the device, and pointing your browser to http://10.10.7.1/device |
I've tried that way - but no one my laptop or mobile see device AP when in pairing mode (S26 with 3+ version SW). Managed to intercept traffic using SSL proxy. |
Having the same issue as @Masterz69 . "error: Error updating service for device xxxxxxxxxx: Padding is incorrect. Probably wrong API key." |
did you get the api key? |
Yeah I got the API Key from ewelinkapi I have to add that I'm using a Sonoff TX Wi-Fi Smart Wall Switch and not a regular sonoff switch. |
If I use the "devicekey" that is returned from ewelinkapi it does work, but I can only find 1 switch on my wall switch, even though it has 2 switches Edit: |
OK, thats good. for "strip" devices you need to specify outlet where first
device=0 is default. Are you using CLI, if so can pass it in. for command
line, it wasn't included but I have forked for that, and ther ewas another
person did it also. Ideally, just use cli, as it very fast in comparison
…On Fri, Jan 22, 2021 at 10:30 PM Roderick Griffioen < ***@***.***> wrote:
If I use the "devicekey" that is returned from ewelinkapi it does work,
but I can only find 1 switch on my wall switch, even though it has 2
switches
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#130 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA7UWOPPWEV3TTNHORJ6ACLS3H367ANCNFSM4OE7QM2Q>
.
|
Hello, mattmo92270 was on the good way. I make some research about the littel part of they programm and i find the solution. I see, the async def look like a while True. And if we wont, send a command to the light, we have to finish the cycle and stop the cycle.
for make that, i make this solution (i change the name of the function. but the result stay the same:
|
my problems with running the script: raspian pi4b pi@raspberrypi:~ $ /home/pi/.local/bin/pysonofflanr3 discover |
Maybe the problem is that you are using python 2.7 instead of a modern 3.X version? |
it helped. |
Nice! |
I know I'm 3 years late but did you find the solution? I'm having the same problem. |
No. Not using anymore. |
should work if API key is correct. Also I have a script that uses the guts of this project but I've updated to overcome a couple issues - this library is no longer maintained |
I intercepted the request between ewelink and the device using SSL proxy and got the API key so it should be correct. Is there any python library I can use to communicate with sonoff pow elite through lan? |
Description
installed software with
pip3 install pysonofflanr3
when I run it without options it runs but when I run it with any command I get
root@orangepipc:/usr/src/pysonofflan# pysonofflanr3 discover
2020-06-22 19:39:08,421 - info: Attempting to discover Sonoff LAN Mode devices on the local network, please wait...
Exception in thread zeroconf-ServiceBrowser__ewelink._tcp.local._3007312992:
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.7/dist-packages/zeroconf/init.py", line 1679, in run
state_change=service_type_state_change[1],
File "/usr/local/lib/python3.7/dist-packages/zeroconf/init.py", line 1433, in fire
h(**kwargs)
File "/usr/local/lib/python3.7/dist-packages/zeroconf/init.py", line 1531, in on_change
listener.add_service(*args)
File "/usr/local/lib/python3.7/dist-packages/pysonofflanr3-1.1.4-py3.7.egg/pysonofflanr3/discover.py", line 40, in add_service
ip = utils.parseAddress(info.address) + ":" + str(info.port)
AttributeError: 'ServiceInfo' object has no attribute 'address'
What I Did
Tried to clone git, install it with
python3 setup.py install
but I get the same results
Thanks!
vrm
The text was updated successfully, but these errors were encountered: