Page 2 of 2

Re: How to control my gate from my smartphone

Posted: Sunday 19 April 2020 13:35
by julienjan
Hi! So i tried to connect my shelly, but i got a problem. I do not have a neutral wire for the alimentation :(
Anyone got an idea for a different alimentation ?

Re: How to control my gate from my smartphone

Posted: Sunday 19 April 2020 23:09
by Geitje
I do not know what you mean by alimentation. Could you post pics/explain further?

Re: How to control my gate from my smartphone

Posted: Sunday 19 April 2020 23:46
by julienjan
Sorry Im stupid Im talking about power supply but in french it’s « alimentation » :? :lol:

Re: How to control my gate from my smartphone

Posted: Monday 20 April 2020 10:36
by Geitje
Power supply always has live and neutral?

Re: How to control my gate from my smartphone

Posted: Monday 20 April 2020 20:02
by julienjan
What do you mean by life ?

Re: How to control my gate from my smartphone

Posted: Monday 20 April 2020 23:02
by Geitje

Re: How to control my gate from my smartphone

Posted: Wednesday 22 April 2020 17:36
by julienjan
I finally made it. Here's a picture: https://i.imgur.com/SAGNol4.jpg
It's a temporary connection. I'll probably switch to a lower power supply because it's less dangerous to manipulate (24/60V or 12V).
What do you think about it ? Anything wrong (unless my picture isn't well taken :roll: ) ?

Also I integrated a button on my Domoticz, here's what I did:
(check this link for more information)
Create a virtual button (type Dummy) in Hardware
Create your button, name it how you want to, and choose the right type (switch...)
Then go to your Shelly settings -> Device Info, and take note of the Device ID and the channel.
Next go to settings user, and get your authorization key (bottom of the page). Take note of the server adress too.
Be sure to be on the http://my.shelly.cloud dashboard and not on the 192.168.xx.xx local adress of your Shelly, or you won't have all of the informations.

Next go to your Domoticz gui, Settings -> More options -> Events and create a LUA event (be sure to enable it).
Put this script in:

Code: Select all

if (devicechanged['NAME_OF_YOUR_VIRTUAL_BUTTON'] == 'ACTION_TO_DETECT')  then
    os.execute ('curl --data "POST_DATA" SHELLY_SERVER_ADRESS)
end
In my example, I only need to detect the On position for my gate because it's a push button so it's state change every time I push it.
The POST_DATA needed are:
turn: [on/off]
channel: the channel you saw in shelly settings
id: id of your device
auth_key: the key you got in your settings user

The SERVER_ADRESS is the adress you saw under you auth_key + /device/relay/control. For me it is https://shelly-10-eu.shelly.cloud so I will use https://shelly-10-eu.shelly.cloud/device/relay/control
A script example:

Code: Select all

if (devicechanged['Gate'] == 'On')  then
    os.execute ('curl --data "turn=on&channel=0&id=MY_DEVICE_ID&auth_key=MjMz[...]9BD0" https://shelly-10-eu.shelly.cloud/device/relay/control')
end
It might not be the fastest way to control the Shelly but it works perfectly. Hope it can help someone.

Re: How to control my gate from my smartphone

Posted: Wednesday 22 April 2020 21:54
by Geitje
Nice one. You do not mention if it works, but I suppose it does?

Re: How to control my gate from my smartphone

Posted: Thursday 23 April 2020 0:17
by julienjan
It might not be the fastest way to control the Shelly but it works perfectly. Hope it can help someone.
Yes it does :D