ShellyCloudPlugin

Python and python framework

Moderator: leecollings

jdfkok
Posts: 2
Joined: Monday 31 August 2020 23:16
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: ShellyCloudPlugin

Post by jdfkok »

Hi, does the plug-in support the Shelly Dimmer 2 as well or should I get the "old" Shelly dimmer?
mariopeters
Posts: 61
Joined: Wednesday 22 August 2018 12:18
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: ShellyCloudPlugin

Post by mariopeters »

jdfkok wrote:Hi, does the plug-in support the Shelly Dimmer 2 as well or should I get the "old" Shelly dimmer?
I should support the Shelly Dimmer 2. I never tried it with the old Shelly Dimmer.
darrepac
Posts: 133
Joined: Tuesday 04 February 2014 21:31
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Isère, France
Contact:

Re: ShellyCloudPlugin

Post by darrepac »

Sorry for the stupid question but it is the first time I am not understanding how to integrate new devices...
So plugin is ok and I configured it in hardware, at the end it says "everything ok the device is added in the devices tab" or something similar... but I have no device in the devices tab... I probably missed something
darrepac
Posts: 133
Joined: Tuesday 04 February 2014 21:31
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Isère, France
Contact:

Re: ShellyCloudPlugin

Post by darrepac »

Errors in the logs:
2020-09-23 12:15:10.629 Error: (ShellyCloudPlugin) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/ShellyCloudPlugin/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-dynload:/usr/local/lib/python3.7/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.7/dist-packages'.
2020-09-23 12:15:10.629 Error: (Shelly Cloud Plugin) Module Import failed, exception: 'ModuleNotFoundError'
2020-09-23 12:15:10.629 Error: (Shelly Cloud Plugin) Module Import failed: ' Name: requests'
2020-09-23 12:15:10.629 Error: (Shelly Cloud Plugin) Error Line details not available.

SO I checked and requests was present for python 2.7 but probably missing for python 3
I needed to install pip for python 3 and install requests then

So it works ok!
2020-09-23 12:23:00.464 Status: (Shelly Cloud Plugin) Entering work loop.
2020-09-23 12:23:00.465 Status: (Shelly Cloud Plugin) Initialized version 1.0.0, author 'Mario Peters'

It created 2 (?) devices: 1 Usage/Electric and 1 General/kWh
MikeyMan
Posts: 237
Joined: Wednesday 17 October 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ShellyCloudPlugin

Post by MikeyMan »

Do i understand correctly that this plugin works with shelly cloud enabled?
darrepac
Posts: 133
Joined: Tuesday 04 February 2014 21:31
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Isère, France
Contact:

Re: ShellyCloudPlugin

Post by darrepac »

MikeyMan wrote: Tuesday 29 September 2020 9:38 Do i understand correctly that this plugin works with shelly cloud enabled?
Yes! that's the big plus comparing to the other plugin that use MQTT (and so you have to disable Cloud)
MikeyMan
Posts: 237
Joined: Wednesday 17 October 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ShellyCloudPlugin

Post by MikeyMan »

Sorry for being a total n00b, but am i correct in assuming that you need to add all shellys manually as 'hardware'? Not as 'device'?

Scripting is not my forte i'm afraid.

First feedback; won't work without username/password :)
mariopeters
Posts: 61
Joined: Wednesday 22 August 2018 12:18
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: ShellyCloudPlugin

Post by mariopeters »

MikeyMan wrote: Tuesday 29 September 2020 9:51 Sorry for being a total n00b, but am i correct in assuming that you need to add all shellys manually as 'hardware'? Not as 'device'?

Scripting is not my forte i'm afraid.

First feedback; won't work without username/password :)
That's correct.
You have to add every Shelly one-by-one as separate devices.
MikeyMan
Posts: 237
Joined: Wednesday 17 October 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ShellyCloudPlugin

Post by MikeyMan »

mariopeters wrote: Tuesday 29 September 2020 11:18
MikeyMan wrote: Tuesday 29 September 2020 9:51 Sorry for being a total n00b, but am i correct in assuming that you need to add all shellys manually as 'hardware'? Not as 'device'?

Scripting is not my forte i'm afraid.

First feedback; won't work without username/password :)
That's correct.
You have to add every Shelly one-by-one as separate devices.
Is it possible to change this? Might make stuff a bit more easily manageable.
darrepac
Posts: 133
Joined: Tuesday 04 February 2014 21:31
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Isère, France
Contact:

Re: ShellyCloudPlugin

Post by darrepac »

I agree...we should have 1 hardware (Shelly) and X devices (all the shellys)
mariopeters
Posts: 61
Joined: Wednesday 22 August 2018 12:18
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: ShellyCloudPlugin

Post by mariopeters »

I understand your point, but I am still thinking about the practical details.
How do you envision that Domoticz finds the different Shelly devices when adding 1 hardware?
With a Domoticz plugin you can only use text fields (or a dropdown list) for configuration.
One solution would be a text field with a list of ip addresses (";" separated).
However, the Shelly devices must all have the same username and password.
Do you see this as a workable solution?
MikeyMan
Posts: 237
Joined: Wednesday 17 October 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ShellyCloudPlugin

Post by MikeyMan »

mariopeters wrote: Tuesday 29 September 2020 18:13 I understand your point, but I am still thinking about the practical details.
How do you envision that Domoticz finds the different Shelly devices when adding 1 hardware?
With a Domoticz plugin you can only use text fields (or a dropdown list) for configuration.
One solution would be a text field with a list of ip addresses (";" separated).
However, the Shelly devices must all have the same username and password.
Do you see this as a workable solution?
Good point. For myself I wouldn’t use a username and password at all.
I cannot imagine people using different passwords for their Shelly’s if i’m honest?
darrepac
Posts: 133
Joined: Tuesday 04 February 2014 21:31
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Isère, France
Contact:

Re: ShellyCloudPlugin

Post by darrepac »

A list of IP separated by ; sounds reasonable
I agree with question above: why do you need username/password? Is it mandatory for using CoAP?
mariopeters
Posts: 61
Joined: Wednesday 22 August 2018 12:18
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: ShellyCloudPlugin

Post by mariopeters »

What do you mean with CoAP?
darrepac
Posts: 133
Joined: Tuesday 04 February 2014 21:31
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Isère, France
Contact:

Re: ShellyCloudPlugin

Post by darrepac »

Thought you were using it: https://shelly-api-docs.shelly.cloud/#coiot-protocol

Which protocol are you using?
mariopeters
Posts: 61
Joined: Wednesday 22 August 2018 12:18
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: ShellyCloudPlugin

Post by mariopeters »

I'm using the regular json api as described on https://shelly-api-docs.shelly.cloud.
I'm not sure if it is the same as CoAP.
Could you explain more about it?
darrepac
Posts: 133
Joined: Tuesday 04 February 2014 21:31
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Isère, France
Contact:

Re: ShellyCloudPlugin

Post by darrepac »

ok so in most cases there is no need of login/password, should be optional:
All resources except for /shelly will require Basic HTTP authentication when it is enabled via /settings/login.
This + the list of ip separated by ";" sounds better to me
mariopeters
Posts: 61
Joined: Wednesday 22 August 2018 12:18
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: ShellyCloudPlugin

Post by mariopeters »

I think I'm able to work this out.
But I need a solution for the Door/Window sensor.
This device is mostly in sleeping modus.
So I'm not able to check the device type by just executing the url http://<ip>/shelly
Darrepac, do you know a solution for this problem?
darrepac
Posts: 133
Joined: Tuesday 04 February 2014 21:31
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Isère, France
Contact:

Re: ShellyCloudPlugin

Post by darrepac »

I guess you may need to activate it before to call the ip ?
No idea
mariopeters
Posts: 61
Joined: Wednesday 22 August 2018 12:18
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: ShellyCloudPlugin

Post by mariopeters »

My experience is that the sensor only remains active for a very short time to be accessed with an http call.
Think I'll have to test with this.
By the way, I still have to change a few things to get this working properly.
Don't expect me to make this adjustment any time soon.
Will post the progress on this forum.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest