Page 7 of 8

Re: ShellyCloudPlugin

Posted: Friday 28 January 2022 13:22
by mariopeters
casaitalia wrote: Saturday 22 January 2022 17:44
mariopeters wrote: Thursday 13 January 2022 19:40 Just added Shelly TRV and Gas functionality.
Please let me know how it works.
If you find any bugs, please leave an issue on the GitHub project issue tracker.
HI, I bought a Shelly TRV and activated your plugin on my domoticz but in the error list I have these messages. Can you help me ? Thank you
2022-01-22 17:40:12.513 Error: (Radiatore_Camera) 'onHeartbeat' failed 'AttributeError'.
2022-01-22 17:40:12.513 Error: (Radiatore_Camera) ----> Line 315 in '/home/pi/domoticz/plugins/ShellyCloudPlugin/plugin.py', function onHeartbeat
2022-01-22 17:40:12.513 Error: (Radiatore_Camera) ----> Line 280 in '/home/pi/domoticz/plugins/ShellyCloudPlugin/plugin.py', function onHeartbeat
2022-01-22 17:40:12.513 Error: (Radiatore_Camera) ----> Line 615 in '/home/pi/domoticz/plugins/ShellyCloudPlugin/plugin.py', function updateTRV
The same plugin with a shelly1 works fine
Think I fixed the bug.
Could you please try it again.
If it still doesn't work, please report an issue in the GitHub project.

Re: ShellyCloudPlugin

Posted: Wednesday 23 February 2022 9:54
by knights
hi mario, my domoticz keeps crashing when using your plugin with a shelly H&T.
Is there any logging or something I can send so you can investigate?

Re: ShellyCloudPlugin

Posted: Wednesday 23 February 2022 17:40
by waltervl
knights wrote: Wednesday 23 February 2022 9:54 hi mario, my domoticz keeps crashing when using your plugin with a shelly H&T.
Is there any logging or something I can send so you can investigate?
Domoticz normally should never crash while using a plugin. But there is a known issue on python plugins in general when you use stable 2022.1 on a RPi with Bullseye. Is that your case?

Re: ShellyCloudPlugin

Posted: Saturday 26 March 2022 19:04
by westanfelda
Hello mario, hello forum

First of all thanks from me to mariopeters for the plugin and your support.

I have the plugin also in use and my plugs work fine.
Now I bought another 3EM, but I can't get it to work in Domoticz....
These error messages are in the log:

Code: Select all

2022-03-26 18:31:37.067 Shelly Sicherungskasten: (Shelly Sicherungskasten) onHeartbeat called
2022-03-26 18:31:37.162 Error: Shelly Sicherungskasten: (Shelly Sicherungskasten) 'onHeartbeat' failed 'KeyError'.
2022-03-26 18:31:37.163 Error: Shelly Sicherungskasten: (Shelly Sicherungskasten) ----> Line 347 in '/opt/domoticz/userdata/plugins/shelly/plugin.py', function onHeartbeat
2022-03-26 18:31:37.163 Error: Shelly Sicherungskasten: (Shelly Sicherungskasten) ----> Line 312 in '/opt/domoticz/userdata/plugins/shelly/plugin.py', function onHeartbeat
2022-03-26 18:31:37.163 Error: Shelly Sicherungskasten: (Shelly Sicherungskasten) ----> Line 778 in '/opt/domoticz/userdata/plugins/shelly/plugin.py', function updateEM
2022-03-26 18:31:37.163 Error: Shelly Sicherungskasten: (Shelly Sicherungskasten) ----> Line 897 in '/opt/domoticz/userdata/plugins/shelly/plugin.py', function updateRelay

2022-03-26 18:31:40.068 Shelly Kuehlschrank: (Shelly Kuehlschrank) onHeartbeat called
2022-03-26 18:31:40.122 Shelly Gefrierschrank: (Shelly Gefrierschrank) onHeartbeat called
2022-03-26 18:31:57.099 Shelly TV Wohnzimmer: (Shelly TV Wohnzimmer) onHeartbeat called
What am I doing wrong?

EDIT: I have now found and tried another plugin: https://github.com/iqas/ShellyEMPlugin
Here everything works, is the error somewhere else?


many greetings
Guido

Re: ShellyCloudPlugin

Posted: Wednesday 06 July 2022 12:37
by jon205
Just tested the Shelly Plug S, works like a charm. I selected the Shelly 1 as a device and it worked straight away.

Re: ShellyCloudPlugin

Posted: Friday 08 July 2022 23:25
by BurnoutVmax
Missing a basic installation manual. This is what I did on my debian10 VM running Domoticz 2022.1;

logged in as root on console;

cd /home/Domoticz/plugins
git clone https://github.com/mario-peters/ShellyCloudPlugin.git ShellyCloudPlugin

cd ShellyCloudPlugin
chmod +x plugin.py

apt-get install python-pip
apt-get install python-requests

apt-get install python3-pip
apt-get install python3-requests

systemctl restart domoticz.service

In Domoticz I added My Shelly 2.5 Roller/Shutter Hardware;
Selected the available "Shelly Cloud Plugin"
Added the Ip address (10.1.1.25), the Username, Password and Type (Shelly 2.5) for my Roller/Shutter (Zonnescherm) device.
I also enabled and set an Username and Password on the Shelly webinterface (because they are mandatory in the plugin)

The shelly is NOT added to my Domoticz Devices. I see following errors;

2022-07-08 22:45:40.284 Error: Zonnescherm: 'onHeartbeat' failed 'KeyError':'1'.
2022-07-08 22:45:40.284 Error: Zonnescherm: Exception traceback:
2022-07-08 22:45:40.284 Error: Zonnescherm: ----> Line 358 in '/home/domoticz/plugins/ShellyCloudPlugin/plugin.py', function onHeartbeat
2022-07-08 22:45:40.284 Error: Zonnescherm: ----> Line 323 in '/home/domoticz/plugins/ShellyCloudPlugin/plugin.py', function onHeartbeat
2022-07-08 22:45:40.284 Error: Zonnescherm: ----> Line 852 in '/home/domoticz/plugins/ShellyCloudPlugin/plugin.py', function updateSHSW25

On https://10.1.1.25/status The shelly is reporting;

{"wifi_sta":{"connected":true,"ssid":"NoFreeWifi","ip":"10.1.1.25","rssi":-47},"cloud":{"enabled":true,"connected":true},"mqtt":{"connected":false},"time":"22:33","unixtime":1657312398,"serial":9894,"has_update":false,"mac":"E8DB1234ABCD","cfg_changed_cnt":10,"actions_stats":{"skipped":0},"rollers":[{"state":"stop","source":"http","power":0.00,"is_valid":true,"safety_switch":false,"overtemperature":false,"stop_reason":"normal","last_direction":"open","current_pos":101,"calibrating":false,"positioning":true}],"meters":[{"power":0.00,"overpower":0.00,"is_valid":true,"timestamp":1657319598,"counters":[0.000, 0.000, 0.000],"total":5528},{"power":0.00,"overpower":0.00,"is_valid":true,"timestamp":1657319598,"counters":[0.000, 0.000, 0.000],"total":6446}],"inputs":[{"input":0,"event":"","event_cnt":0},{"input":0,"event":"","event_cnt":0}],"temperature":51.42,"overtemperature":false,"tmp":{"tC":51.42,"tF":124.56, "is_valid":true},"temperature_status":"Normal","update":{"status":"idle","has_update":false,"new_version":"20220209-093016/v1.11.8-g8c7bb8d","old_version":"20220209-093016/v1.11.8-g8c7bb8d"},"ram_total":49920,"ram_free":35384,"fs_size":233681,"fs_free":146082,"voltage":234.72,"uptime":2342299}

What's going wrong here?

Re: ShellyCloudPlugin

Posted: Sunday 31 July 2022 20:18
by Anagonda
@burnoutvmax did you find any fix?

I have new install Domoticz on Ubuntu 20.04 and I have the same error as you did.
My house has Shelly 1PM and also 3EM.

First I tried to read 3EM but it failed. Then I tried 1PM and was a bit confused as there was no 1PM on the list, so selected PM. Similar error.
I tried many things but the errors in log kept coming. Then I changed the 1PM to "Shelly 1" and it reads fine and no errors!
So I think there is something wrong with the drop down selection. As when I select something else than "Shelly 1" I get an error:

Code: Select all

2022-07-31 20:25:36.680 Error: Shelly IV-kone: 'onStart' failed 'AttributeError':''BasePlugin' object has no attribute 'SHELLY_IX3''.
2022-07-31 20:25:36.680 Error: Shelly IV-kone: Exception traceback:
2022-07-31 20:25:36.680 Error: Shelly IV-kone: ----> Line 330 in '/home/anagonda/domoticz/plugins/ShellyCloud/plugin.py'
2022-07-31 20:25:36.680 Error: Shelly IV-kone: ----> Line 132 in '/home/anagonda/domoticz/plugins/ShellyCloud/plugin.py'
After those lines I start to get same errors as butnoutvmax had:

Code: Select all

2022-07-31 20:26:06.144 Error: Shelly IV-kone: 'onHeartbeat' failed 'KeyError':'1'.
2022-07-31 20:26:06.144 Error: Shelly IV-kone: Exception traceback:
2022-07-31 20:26:06.144 Error: Shelly IV-kone: ----> Line 358 in '/home/anagonda/domoticz/plugins/ShellyCloud/plugin.py'
2022-07-31 20:26:06.144 Error: Shelly IV-kone: ----> Line 323 in '/home/anagonda/domoticz/plugins/ShellyCloud/plugin.py'
2022-07-31 20:26:06.144 Error: Shelly IV-kone: ----> Line 827 in '/home/anagonda/domoticz/plugins/ShellyCloud/plugin.py'
2022-07-31 20:26:06.144 Error: Shelly IV-kone: ----> Line 939 in '/home/anagonda/domoticz/plugins/ShellyCloud/plugin.py'
So the same 1PM works ok if I select "Shelly 1". But it fails if I select "Shelly PM".
Same issue with 3EM. It fails with similar message about Baseplugin has no 'SHELLY_IX3'.
What ever I select I get the same SHELLY_IX3 error. So I think the drop down selection box does not work in domoticz?

EDIT: Just for reference, the error when I try to add 3EM:

Code: Select all

2022-07-31 21:19:35.858 Error: Shelly Varaaja: 'onStart' failed 'AttributeError':''BasePlugin' object has no attribute 'SHELLY_IX3''.
2022-07-31 21:19:35.858 Error: Shelly Varaaja: Exception traceback:
2022-07-31 21:19:35.858 Error: Shelly Varaaja: ----> Line 330 in '/home/anagonda/domoticz/plugins/ShellyCloud/plugin.py'
2022-07-31 21:19:35.858 Error: Shelly Varaaja: ----> Line 132 in '/home/anagonda/domoticz/plugins/ShellyCloud/plugin.py
EDIT2: I added: " SHELLY_IX3="SHIX3"" to line 73 to get rid of the AttributError. But sad to say that same lines still give error on 3EM and 1PM.

Re: ShellyCloudPlugin

Posted: Monday 01 August 2022 14:22
by BurnoutVmax
No solution yet.

My objective was to have Shelly cloud enabled AND having my Shellies working within Domoticz.

Now I'm using MQTT, but it's not supported simultaniously with Shelly Cloud enabled. And it doesn't look like they will change this for all shellies in the near future.

A bit of a shame...

Re: ShellyCloudPlugin

Posted: Friday 19 August 2022 17:13
by Anagonda
Seems author released a bug fix for the AttributeError. Tried this version and now the attributeError has disappeared, but still have the same problem with 3em:

Code: Select all

2022-08-19 18:11:08.066 Shelly varaaja: onHeartbeat called
2022-08-19 18:11:08.098 Error: Shelly varaaja: 'onHeartbeat' failed 'KeyError':'31'.
2022-08-19 18:11:08.098 Error: Shelly varaaja: Exception traceback:
2022-08-19 18:11:08.098 Error: Shelly varaaja: ----> Line 360 in '/home/anagonda/domoticz/plugins/ShellyCloud/plugin.py'
2022-08-19 18:11:08.098 Error: Shelly varaaja: ----> Line 325 in '/home/anagonda/domoticz/plugins/ShellyCloud/plugin.py'
2022-08-19 18:11:08.098 Error: Shelly varaaja: ----> Line 816 in '/home/anagonda/domoticz/plugins/ShellyCloud/plugin.py'
2022-08-19 18:11:08.098 Error: Shelly varaaja: ----> Line 974 in '/home/anagonda/domoticz/plugins/ShellyCloud/plugin.py'
EDIT: Added this as an issue to github as it seems the author is there more active.

Re: ShellyCloudPlugin

Posted: Wednesday 24 August 2022 14:30
by Anagonda
Fyi, Mario fixed the bug! I haven't had time to test it so hope it works.

Re: ShellyCloudPlugin

Posted: Saturday 27 August 2022 14:40
by BurnoutVmax
Now the plugin works. Thanks.

Re: ShellyCloudPlugin

Posted: Monday 26 September 2022 10:33
by snellejellep
how does this work?
i installed the plugin but it does not appear in the hardware selector
am i missing something?
i followed the steps in the post of BurnoutVmax

Re: ShellyCloudPlugin

Posted: Monday 26 September 2022 11:18
by mariopeters
snellejellep wrote: Monday 26 September 2022 10:33 how does this work?
i installed the plugin but it does not appear in the hardware selector
am i missing something?
i followed the steps in the post of BurnoutVmax
Did you check the Domoticz logging after restarting Domoticz?
If there are issues with the plugin on the startup, you should see them?

Re: ShellyCloudPlugin

Posted: Monday 26 September 2022 12:44
by snellejellep
mariopeters wrote: Monday 26 September 2022 11:18 Did you check the Domoticz logging after restarting Domoticz?
If there are issues with the plugin on the startup, you should see them?
i see no errors, not even a mention of the plugin

i am using docker, maby that has something to do with it?

Re: ShellyCloudPlugin

Posted: Monday 26 September 2022 13:51
by mariopeters
Are other plugins starting correctly?
Perhaps the rights aren't correct.
The easiest way is to do a "git clone ..." with the same user which is running Domoticz.
It should work after restarting Domoticz.

Re: ShellyCloudPlugin

Posted: Tuesday 27 September 2022 9:38
by snellejellep
figured it out. it was my docker install, it is not using the typical plugins folder.
so not domoticz > plugins but domoticz > userdata > plugins.
now it is working.

Re: ShellyCloudPlugin

Posted: Tuesday 27 September 2022 11:37
by mariopeters
:D

Re: ShellyCloudPlugin

Posted: Sunday 02 October 2022 12:03
by jovo
Hello,

Trying to control a Shelly TRV through Domoticz but I am having some challanges with this shelly cloud plugin.

Have it installed succesfully i think using git clone.
when adding the plugin under hardware, i get this error in the log when Domoticz restarts:

Code: Select all

 2022-10-02 11:56:50.269  Shelly TRV: Worker thread started.
2022-10-02 11:56:50.269  Status: Shelly TRV: Started.
2022-10-02 11:56:50.269  Status: Shelly TRV: Entering work loop.
2022-10-02 11:56:50.471  Status: Shelly TRV: Initialized version 1.0.1, author 'Mario Peters'
2022-10-02 11:56:50.472  Shelly TRV: onStart called
2022-10-02 11:56:50.945  Error: Shelly TRV: 'onStart' failed 'JSONDecodeError':'Expecting value: line 1 column 1 (char 0)'.
2022-10-02 11:56:50.946  Error: Shelly TRV: Exception traceback:
2022-10-02 11:56:50.946  Error: Shelly TRV:  ----> Line 336 in '/home/john/domoticz/plugins/ShellyCloudPlugin/plugin.py'
2022-10-02 11:56:50.946  Error: Shelly TRV:  ----> Line 134 in '/home/john/domoticz/plugins/ShellyCloudPlugin/plugin.py'
2022-10-02 11:56:50.946  Error: Shelly TRV:  ----> Line 357 in '/usr/lib/python3.8/json/__init__.py'
2022-10-02 11:56:50.946  Error: Shelly TRV:  ----> Line 337 in '/usr/lib/python3.8/json/decoder.py'
2022-10-02 11:56:50.946  Error: Shelly TRV:  ----> Line 355 in '/usr/lib/python3.8/json/decoder.py'
I am using Version 2022.1 (January 31 2022) of Domoticz on Ubuntu 20.04.5 LTS
And pip 22.2.2 from /home/john/.local/lib/python3.8/site-packages/pip (python 3.8)

Anyone any thoughts?

Re: ShellyCloudPlugin

Posted: Monday 03 October 2022 10:44
by mariopeters
Could you please create an issue in the GitHub project.
could you also add the json output of the following url "http://<IP address TRV>/settings"

Re: ShellyCloudPlugin

Posted: Monday 03 October 2022 21:20
by jovo
mariopeters wrote: Monday 03 October 2022 10:44 Could you please create an issue in the GitHub project.
could you also add the json output of the following url "http://<IP address TRV>/settings"
Absolutely, done!
looking forward to get your feedback.