GithubHelp home page GithubHelp logo

pyshelly's People

Contributors

chemelli74 avatar chpego avatar dlarrick avatar estefanogoncalves avatar fabaff avatar hakana avatar heubergerbeontra avatar jagu2012 avatar martin3000 avatar mlq avatar n3tkiller avatar rwunsch avatar tefinger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyshelly's Issues

Is there a documentation?

Hi, thanks for your effort implementing this library. I came here to show values measured by my shelly h&t but I do not really know how to set it up. Is there anywhere any kind of documentation or an example?

No 'version' key in the manifest file

Upon starting Home Assistant (ver 2021.3.4) I have the following message:

2021-03-27 17:14:55 WARNING (MainThread) [homeassistant.loader] No 'version' key in the manifest file for custom integration 'shelly'. This will not be allowed in a future version of Home Assistant. Please report this to the maintainer of 'shelly'

Exception while trying to look for firmware updates

Tonight, here was a switch to DST (summer time) and the clock went from 2 o'clock directly to 3 o'clock. This triggered something and I got 1000 lines of exceptions in the log. Is this the output of the "exception_log" function?
Between 3 o'clock and 6 o'clock, my wifi is off. Normally, this is no problem. pyShelly is version 0.3.5

2022-03-27 03:00:36 ERROR (FirmwareManage) [pyShelly] Error http GET: https://api.shelly.cloud/files/firmware, HTTP Error 502: Bad Gateway, Traceback (most recent call last):
  File "/home/nuc/.homeassistant/deps/lib/python3.9/site-packages/pyShelly/firmware.py", line 29, in _http_get
    f = urlopen(url)
  File "/home/nuc/.homeassistant/deps/lib/python3.9/site-packages/pyShelly/compat.py", line 44, in urlopen
    return urllib.request.urlopen(x)
  File "/usr/lib/python3.9/urllib/request.py", line 214, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.9/urllib/request.py", line 523, in open
    response = meth(req, response)
  File "/usr/lib/python3.9/urllib/request.py", line 632, in http_response
    response = self.parent.error(
  File "/usr/lib/python3.9/urllib/request.py", line 561, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.9/urllib/request.py", line 494, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.9/urllib/request.py", line 641, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 502: Bad Gateway
Traceback (most recent call last):
  File "/home/nuc/.homeassistant/deps/lib/python3.9/site-packages/pyShelly/firmware.py", line 29, in _http_get
    f = urlopen(url)
  File "/home/nuc/.homeassistant/deps/lib/python3.9/site-packages/pyShelly/compat.py", line 44, in urlopen
    return urllib.request.urlopen(x)
  File "/usr/lib/python3.9/urllib/request.py", line 214, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.9/urllib/request.py", line 523, in open
    response = meth(req, response)
  File "/usr/lib/python3.9/urllib/request.py", line 632, in http_response
    response = self.parent.error(
  File "/usr/lib/python3.9/urllib/request.py", line 561, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.9/urllib/request.py", line 494, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.9/urllib/request.py", line 641, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 502: Bad Gateway


2022-03-27 03:12:16 ERROR (FirmwareManage) [pyShelly] Error http GET: https://api.shelly.cloud/files/firmware, <urlopen error [Errno 110] Connection timed out>, Traceback (most recent call last):
  File "/usr/lib/python3.9/urllib/request.py", line 1346, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/usr/lib/python3.9/http/client.py", line 1257, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.9/http/client.py", line 1303, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.9/http/client.py", line 1252, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.9/http/client.py", line 1012, in _send_output
    self.send(msg)
  File "/usr/lib/python3.9/http/client.py", line 952, in send
    self.connect()
  File "/usr/lib/python3.9/http/client.py", line 1419, in connect
    super().connect()
  File "/usr/lib/python3.9/http/client.py", line 923, in connect
    self.sock = self._create_connection(
  File "/usr/lib/python3.9/socket.py", line 843, in create_connection
    raise err
  File "/usr/lib/python3.9/socket.py", line 831, in create_connection
    sock.connect(sa)
TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/nuc/.homeassistant/deps/lib/python3.9/site-packages/pyShelly/firmware.py", line 29, in _http_get
    f = urlopen(url)
  File "/home/nuc/.homeassistant/deps/lib/python3.9/site-packages/pyShelly/compat.py", line 44, in urlopen
    return urllib.request.urlopen(x)
  File "/usr/lib/python3.9/urllib/request.py", line 214, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.9/urllib/request.py", line 517, in open
    response = self._open(req, data)
  File "/usr/lib/python3.9/urllib/request.py", line 534, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib/python3.9/urllib/request.py", line 494, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.9/urllib/request.py", line 1389, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/usr/lib/python3.9/urllib/request.py", line 1349, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 110] Connection timed out>
Traceback (most recent call last):
  File "/usr/lib/python3.9/urllib/request.py", line 1346, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/usr/lib/python3.9/http/client.py", line 1257, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.9/http/client.py", line 1303, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.9/http/client.py", line 1252, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.9/http/client.py", line 1012, in _send_output
    self.send(msg)
  File "/usr/lib/python3.9/http/client.py", line 952, in send
    self.connect()
  File "/usr/lib/python3.9/http/client.py", line 1419, in connect
    super().connect()
  File "/usr/lib/python3.9/http/client.py", line 923, in connect
    self.sock = self._create_connection(
  File "/usr/lib/python3.9/socket.py", line 843, in create_connection
    raise err
  File "/usr/lib/python3.9/socket.py", line 831, in create_connection
    sock.connect(sa)
TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/nuc/.homeassistant/deps/lib/python3.9/site-packages/pyShelly/firmware.py", line 29, in _http_get
    f = urlopen(url)
  File "/home/nuc/.homeassistant/deps/lib/python3.9/site-packages/pyShelly/compat.py", line 44, in urlopen
    return urllib.request.urlopen(x)
  File "/usr/lib/python3.9/urllib/request.py", line 214, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.9/urllib/request.py", line 517, in open
    response = self._open(req, data)
  File "/usr/lib/python3.9/urllib/request.py", line 534, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib/python3.9/urllib/request.py", line 494, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.9/urllib/request.py", line 1389, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "/usr/lib/python3.9/urllib/request.py", line 1349, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 110] Connection timed out>

Use build-in MQTT broker

Hi there,
consider using build-in broker, like Mosquitto.
It is easy to setup and many times users already use it.
Not sure if having two MQTT brokers will be damage, but why not use the one already on home assistant. Performance will be better I think.

Thank you for awesome work!!! ๐ŸŽ‰

[Discussion] exception_log outputs too much information

A previsible error on the unability to reach for firmware update status yields a long, convoluted error:

2021-03-27 08:44:29 ERROR (FirmwareManage) [pyShelly] Error http GET: https://repo.shelly.cloud/files/firmware, HTTP Error 400: Bad Request, Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pyShelly/firmware.py", line 29, in _http_get
    f = urllib.request.urlopen(url)
  File "/usr/local/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/local/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/usr/local/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/local/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pyShelly/firmware.py", line 29, in _http_get
    f = urllib.request.urlopen(url)
  File "/usr/local/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/local/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/usr/local/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/local/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request

It comes from the use of exception_log at https://github.com/StyraHem/pyShelly/blob/master/pyShelly/firmware.py#L34.

Would it be possible to change https://github.com/StyraHem/pyShelly/blob/master/pyShelly/utils.py#L36 to not output the Traceback, just a generic ERROR? The first line of the log

 2021-03-27 08:54:29 ERROR (FirmwareManage) [pyShelly] Error http GET: https://repo.shelly.cloud/files/firmware, HTTP Error 400: Bad Request,

would be great (and enough information). Maybe using a debug mode to output everything would be a solution?

Documentation, or a more visible link to it if it exists

I'd like to use this library, but I can't see any documentation or homepages linked in Github, nor on PyPI. The only demo script (copied below) has no explanations, and does not work anyway because of a bug that has a fix (#71 ) that apparently has been waiting to be merged for two years.

It may be that there is documentation! In which case, my ticket would be a suggestion for more visible links to it.

What is the Shelly 1PM Bug?

We've been having issues with our Shelly 1PMs not responding and I wondered what the bug was? And if there is a soloution to it?

Shelly Plus PM Mini support

https://www.shelly.com/en/products/shop/shelly-plus-pm-mini

Topic: shellypmmini-6055f999dfd4/status/pm1:0
{"id":0, "voltage":238.3, "current":0.020, "apower":1.6 ,"freq":50.0,"aenergy":{"total":12.948,"by_minute":[0.000,0.000,0.000],"minute_ts":1698852539}}

Topic: shellypmmini-6055f999dfd4/events/rpc
{"src":"shellypmmini-6055f999dfd4","dst":"shellypmmini-6055f999dfd4/events","method":"NotifyStatus","params":{"ts":1698852540.24,"pm1:0":{"id":0,"aenergy":{"by_minute":[0.000,0.000,0.000],"minute_ts":1698852539,"total":12.948}}}}

Doesn't have a switch.

imagem

exception when loading shelly device in HA

the url contains hebrew charecters
[{"name":"ืขืžื•ื“ื™ื ืคื ื™ื","ison":false,"has_timer":false,
2020-11-27 16:09:34 ERROR (CoAP) [pyShelly] Error http GET: http://192.168.0.105/settings, 'charmap' codec can't decode byte 0x9d in position 1700: character maps to , Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pyShelly/utils.py", line 63, in shelly_http_get
res = json.loads(s(body))
File "/usr/local/lib/python3.8/site-packages/pyShelly/compat.py", line 23, in s
return str(x, 'cp1252')
File "/usr/local/lib/python3.8/encodings/cp1252.py", line 15, in decode
return codecs.charmap_decode(input,errors,decoding_table)
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 1700: character maps to
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pyShelly/utils.py", line 63, in shelly_http_get
res = json.loads(s(body))
File "/usr/local/lib/python3.8/site-packages/pyShelly/compat.py", line 23, in s
return str(x, 'cp1252')
File "/usr/local/lib/python3.8/encodings/cp1252.py", line 15, in decode
return codecs.charmap_decode(input,errors,decoding_table)
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 1700: character maps to

Shelly 1 PRO

Hi,

i have the new "Shelly 1 PRO",
in HomeAssistant 2022.5 (latest) i have this error :

**Log Details (WARNING)**

Logger: pyShelly
Source: /usr/local/lib/python3.9/site-packages/pyShelly/utils.py:76
First occurred: May 14, 2022, 11:56:19 PM (3 occurrences)
Last logged: May 14, 2022, 11:58:19 PM

Error, 404 Not Found http://< IP >/status

If i acess direct to "http://< IP >/" the device is there and all ok with it.

It seems that the 1 PRO does not have the standard "/status" page, so it gives the error .

Maybe its difrent on this model ?
https://shelly-api-docs.shelly.cloud/gen2/Components/SystemComponents/Sys#sysgetstatus-example

Because if i go to :
http:// < IP >/rpc/Sys.GetStatus

i do get Info , like this :
image

{"mac":"30C6Fxxxxxxxxx","restart_required":false,"time":"00:30","unixtime":1652571058,"uptime":844,"ram_size":239296,"ram_free":165568,"fs_size":524288,"fs_free":282624,"cfg_rev":51,"available_updates":{"beta":{"version":"0.10.2-beta1"}}}

Help pls

Tanks

[pyShelly] Can't setup CoAP listener

I just did a restore of a full Home Assistant backup after my system had crashed. Complete fresh install on a Raspberry Pi 4. Now I get the following error:

2021-09-02 22:40:49 ERROR (MainThread) [pyShelly] Can't setup CoAP listener

I'm running ShellyForHass 0.2.2

Issue in pyshelly is flooding the logfile

I'm not sure, where the problem is coming from, but i recognized this problem in my logs since the last firmware update of the shelly devices.

I'm running latest Home Assistant Version 2021.7.4 with latest Shelly4HASS Version 0.2.3.beta.2

Any help are much appreciate!

Logger: pyShelly
Source: /usr/local/lib/python3.9/site-packages/pyShelly/utils.py:39
First occurred: 10:27:55 AM (96223 occurrences)
Last logged: 10:34:21 AM

Error update loop, '>' not supported between instances of 'datetime.timedelta' and 'int', Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/pyShelly/init.py", line 335, in _update_loop block.loop() File "/usr/local/lib/python3.9/site-packages/pyShelly/block.py", line 141, in loop if self._need_setup_delayed_devices and self._check_delay_load.check(): File "/usr/local/lib/python3.9/site-packages/pyShelly/utils.py", line 29, in check now - self._last_time > self._interval: TypeError: '>' not supported between instances of 'datetime.timedelta' and 'int'
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/pyShelly/init.py", line 335, in _update_loop
block.loop()
File "/usr/local/lib/python3.9/site-packages/pyShelly/block.py", line 141, in loop
if self._need_setup_delayed_devices and self._check_delay_load.check():
File "/usr/local/lib/python3.9/site-packages/pyShelly/utils.py", line 29, in check
now - self._last_time > self._interval:
TypeError: '>' not supported between instances of 'datetime.timedelta' and 'int'

[pyShelly] Error adding device

Hi everyone,

I'm getting these errors since yesterday. Is pyShelly not installed correctly?

Running in Docker on Synology NAS.

2020-04-12 18:02:40 WARNING (Poll) [pyShelly] Error, 404 Not Found                                                                                                                                       
2020-04-12 18:02:40 INFO (Poll) [pyShelly] Error adding device, 172.30.32.1

I've set it up in configuration.yaml. Both Shelly's are already visible in Integrations and are working.

shelly:
 username: admin
 password: !secret shellypassword

Also this:
firefox_ZmNifsGt5L

Any ideas?

exceptions in my HA log

with helly for hass 0.2.1


2020-09-18 14:22:15 ERROR (Poll status) [pyShelly] Error update device status: B9378B-2 SHSW-25, list index out of range, Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pyShelly/block.py", line 174, in update_status_information
    dev._update_state(status, dev._state_cfg)
  File "/usr/local/lib/python3.8/site-packages/pyShelly/base.py", line 84, in _update_state
    value = self._get_status_value(status, cfg)
  File "/usr/local/lib/python3.8/site-packages/pyShelly/base.py", line 78, in _get_status_value
    value = value[ch]
IndexError: list index out of range


Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pyShelly/block.py", line 178, in update_status_information
    dev.update_status_information(status)
  File "/usr/local/lib/python3.8/site-packages/pyShelly/switch.py", line 74, in update_status_information
    value = inputs[self._channel]
IndexError: list index out of range

RGBW2-Switch state not updated

The Switch class fails to update state changes for RGBW2 devices. These deliver only a single input key in the state collection instead of an inputs list containing input keys.

Unicode Decode Error when accessing /settings

Error http GET: http://10.0.0.14/settings, 'charmap' codec can't decode byte 0x81 in position 203: character maps to <undefined>, Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/pyShelly/utils.py", line 62, in shelly_http_get res = json.loads(s(body)) File "/usr/local/lib/python3.7/site-packages/pyShelly/compat.py", line 23, in s return str(x, 'cp1252') File "/usr/local/lib/python3.7/encodings/cp1252.py", line 15, in decode return codecs.charmap_decode(input,errors,decoding_table) UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 203: character maps to <undefined>
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/pyShelly/utils.py", line 62, in shelly_http_get
    res = json.loads(s(body))
  File "/usr/local/lib/python3.7/site-packages/pyShelly/compat.py", line 23, in s
    return str(x, 'cp1252')
  File "/usr/local/lib/python3.7/encodings/cp1252.py", line 15, in decode
    return codecs.charmap_decode(input,errors,decoding_table)
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 203: character maps to <undefined>

ERROR (Poll status) [pyShelly] Timeout connecting to http://192.168.xx.xx/status

Hello,

in my HA log following errors started to appear about 3 weeks ago (randomly about 50-100 error logs per day):

ERROR (Poll status) [pyShelly] Timeout connecting to http://192.168.xx.xx/status

The URL is accessible fine from client on local netowork. The error appears for different shelly devices (different IPs). My configuration:

  • pyShelly 0.2.0 (latest)
  • Supervised Home Assistant 0.117.2 (latest) running in docker on Synology NAS DS918+
  • docker container is configured to use host network

The problem is probably network related. Is there a way I can test the URL directly from docker environment? Or any other suggestions? Thank you.

Shelly smoke

I have tried every combination in shelly settings for Web hooks, the device isn't being recognised, I also have this error for the ip address of the detector?

Logger: pyShelly
Source: /usr/local/lib/python3.10/site-packages/pyShelly/utils.py:84
First occurred: 7 May 2023 at 03:14:30 (3 occurrences)
Last logged: 7 May 2023 at 21:37:43

Error, 404 Not Found http://< ip address>/status.

Add more logs

Hi there,
I really enjoy using ShellyForHASS and I really hope it will be added to HA as an official integration.
But unfortunately, like many others, I sometimes have issues with devices getting unavailable.
This was described many times, for example here

I'd like to ask for adding more logs into pySHelly (because it is sed by ShellyForHASS).
This will allow us, the users to gather logs, that hopefully will allow us to figure out the source of that issue.

I've noticed that in init_socket You are adding a timeout of 15s (I think these are seconds) -

def init_socket(self):

Maybe because of larger traffic on routers (especially meshes) this can get larger and because of that the message isn't correctly read? I don't know Python so this is more of a guess.

Devices not found

I'm using pyShelly (installed via pip install pyShelly) version 0.0.30 in a python 3.7.3 virtual environment on a raspberryPi 3B+ connected via ethernet.
In the same network there are 2 shelly devices: a shelly1 and a shelly2, both with CoAP option enabled.
When I run the script provided in the readme file nothing is printed.
What's the problem? I'm missing something?

import pyShelly from pyShelly

def device_added(dev):
  print (dev.devType)

shelly = pyShelly()
shelly.cb_device_added.append(device_added)
shelly.open()
shelly.discover()

mDns discovery, problem between VLANS

Continually get the following message in logs:

"WARNING (Poll) [pyShelly] Error, 301 Moved Permanently"
"/usr/local/lib/python3.7/site-packages/pyShelly/utils.py (WARNING)"

Everything seems to work fine but the message persists. I have reinstalled home assistant a few times and the message always comes back. I will get thousands of these messages.

I have the latest version of HASS, and pyshelly via HACS. Running HASS via docker not hassio. Not sure if it matters but I have the Shellies on a VLAN and use the proxy setup to send messages across the VLAN into the LAN. Been getting that message for weeks now.

MQTT parsing error shelly1pluspm

example MQTT info:
topic: "shellies/shellyplus1pm-3083980a70ac/status/switch:0"
payload: "{"id":0, "source":"init", "output":true, "apower":291.5, "voltage":226.5, "current":1.437, "aenergy":{"total":80.415,"by_minute":[3619.099,4730.434,4729.123],"minute_ts":1652655284},"temperature":{"tC":63.2, "tF":145.7}}"

RPC notifications disabled in Shelly config.

resulting in the following errors in HA logs:
2022-05-16 08:57:59 ERROR (Thread-9) [pyShelly] Error parsing MQTT message, Client, shellies/shellyplus1pm-3083980a70ac/status/switch:0
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/pyShelly/mqtt.py", line 64, in receive_msg
self._root.update_block(device_id,
File "/usr/local/lib/python3.9/site-packages/pyShelly/init.py", line 355, in update_block
block.update_mqtt(payload)
File "/usr/local/lib/python3.9/site-packages/pyShelly/block.py", line 169, in update_mqtt
data = data['params'] if 'params' in data else data['result']
KeyError: 'result'

error in homeassistant

I'm getting the following error in homeassistant

Logger: root
Source: /usr/src/homeassistant/homeassistant/bootstrap.py:549
First occurred: May 11, 2024 at 10:52:05 AM (2777 occurrences)
Last logged: 9:11:59 AM

Uncaught thread exception
Traceback (most recent call last):
 File "/usr/local/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
   self.run()
 File "/usr/local/lib/python3.12/threading.py", line 1010, in run
   self._target(*self._args, **self._kwargs)
 File "/usr/local/lib/python3.12/site-packages/pyShelly/block.py", line 238, in update_status_information
   LOGGER.debug("Get status from %s %s", self.id, self.friendly_name())
                                                  ^^^^^^^^^^^^^^^^^^^^
 File "/usr/local/lib/python3.12/site-packages/pyShelly/block.py", line 680, in friendly_name
   return self.type_name() + ' - ' + self.id
          ~~~~~~~~~~~~~~~~~^~~~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

Although it's hard to see which device this is, it might be my temperature/humidity sensor. In the shelly interface (cloud) they have some different fields from my 'regular' shelly devices

Discovery can avoid multicast ?

Hi,

many of us have issues on their routers with Multicast on 224.0.1.187.

Can the discovery be switched to another protocol ?
Or is the Multicast mandatory for the subseguent usage of the tool ?

Thank you in advance for your help and effort.
Cheers,

Simone

Shelly Mini

I can't seem to add any Shelly mini's into my HA.... They never show up, every other device I have does. But not Mini.. Can someone please help ?

I wanted to do this : https://github.com/elwombatto/pyShelly and replace it with the original, so it maybe would work. But I don't know how to replace it.. I'm lost here. Please help

Trigger of device update after turn on/off

I noticed that after issuing a turn on or turn off command to an RGBW2 device it takes up to a minute until the state change is updated in HASS. I've done some code analysis and found in module pyShelly.device line 75 (in _send_command) should modify self.block.last_update_status_info instead of self.block.update_status_interval. I have tried that locally and it seems to work.

What I don't understand is that relay devices seem not to suffer from this.

EDIT: After some more investigation: it looks like the relay devices (Shelly-1 and 2.5) are updated by CoAP messages (code=30). For RGBW2 devices only Code=69 is received and updates are only done by the polling loop using Block.update_status_information (with a period of update_status_interval.
Is the RGBW2 sending no CoAP status updates? (For instance when the status of switch input changes )

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.