Page 2 of 8

Re: ShellyCloudPlugin

Posted: Monday 31 August 2020 23:23
by jdfkok
Hi, does the plug-in support the Shelly Dimmer 2 as well or should I get the "old" Shelly dimmer?

Re: ShellyCloudPlugin

Posted: Tuesday 01 September 2020 7:05
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.

Re: ShellyCloudPlugin

Posted: Tuesday 22 September 2020 0:09
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

Re: ShellyCloudPlugin

Posted: Wednesday 23 September 2020 12:29
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

Re: ShellyCloudPlugin

Posted: Tuesday 29 September 2020 9:38
by MikeyMan
Do i understand correctly that this plugin works with shelly cloud enabled?

Re: ShellyCloudPlugin

Posted: Tuesday 29 September 2020 9:42
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)

Re: ShellyCloudPlugin

Posted: Tuesday 29 September 2020 9:51
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 :)

Re: ShellyCloudPlugin

Posted: Tuesday 29 September 2020 11:18
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.

Re: ShellyCloudPlugin

Posted: Tuesday 29 September 2020 14:13
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.

Re: ShellyCloudPlugin

Posted: Tuesday 29 September 2020 14:31
by darrepac
I agree...we should have 1 hardware (Shelly) and X devices (all the shellys)

Re: ShellyCloudPlugin

Posted: Tuesday 29 September 2020 18:13
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?

Re: ShellyCloudPlugin

Posted: Tuesday 29 September 2020 18:30
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?

Re: ShellyCloudPlugin

Posted: Tuesday 29 September 2020 19:17
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?

Re: ShellyCloudPlugin

Posted: Tuesday 29 September 2020 22:23
by mariopeters
What do you mean with CoAP?

Re: ShellyCloudPlugin

Posted: Tuesday 29 September 2020 22:39
by darrepac
Thought you were using it: https://shelly-api-docs.shelly.cloud/#coiot-protocol

Which protocol are you using?

Re: ShellyCloudPlugin

Posted: Tuesday 29 September 2020 23:51
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?

Re: ShellyCloudPlugin

Posted: Wednesday 30 September 2020 8:14
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

Re: ShellyCloudPlugin

Posted: Wednesday 30 September 2020 10:19
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?

Re: ShellyCloudPlugin

Posted: Wednesday 30 September 2020 10:44
by darrepac
I guess you may need to activate it before to call the ip ?
No idea

Re: ShellyCloudPlugin

Posted: Wednesday 30 September 2020 11:18
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.