How to control my gate from my smartphone

On various Hardware and OS systems: pi / windows / routers / nas, etc

Moderator: leecollings

julienjan
Posts: 18
Joined: Saturday 18 May 2019 17:51
Target OS: NAS (Synology & others)
Domoticz version: 4.9700
Location: France, Bretagne
Contact:

Re: How to control my gate from my smartphone

Post 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 ?
Domoticz v4.9700 on NAS Synology DS115j, RFLink on Arduino Mega 2560 (nodo-shop.nl) controlling Somfy RTS blinds, Shelly 1
Geitje
Posts: 170
Joined: Monday 22 January 2018 21:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to control my gate from my smartphone

Post by Geitje »

I do not know what you mean by alimentation. Could you post pics/explain further?
Domoticz beta, on Raspberry Pi 3B, Raspian Buster
Zwave, Zigate, RFlink etc.
julienjan
Posts: 18
Joined: Saturday 18 May 2019 17:51
Target OS: NAS (Synology & others)
Domoticz version: 4.9700
Location: France, Bretagne
Contact:

Re: How to control my gate from my smartphone

Post by julienjan »

Sorry Im stupid Im talking about power supply but in french it’s « alimentation » :? :lol:
Domoticz v4.9700 on NAS Synology DS115j, RFLink on Arduino Mega 2560 (nodo-shop.nl) controlling Somfy RTS blinds, Shelly 1
Geitje
Posts: 170
Joined: Monday 22 January 2018 21:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to control my gate from my smartphone

Post by Geitje »

Power supply always has live and neutral?
Last edited by Geitje on Monday 20 April 2020 23:01, edited 1 time in total.
Domoticz beta, on Raspberry Pi 3B, Raspian Buster
Zwave, Zigate, RFlink etc.
julienjan
Posts: 18
Joined: Saturday 18 May 2019 17:51
Target OS: NAS (Synology & others)
Domoticz version: 4.9700
Location: France, Bretagne
Contact:

Re: How to control my gate from my smartphone

Post by julienjan »

What do you mean by life ?
Domoticz v4.9700 on NAS Synology DS115j, RFLink on Arduino Mega 2560 (nodo-shop.nl) controlling Somfy RTS blinds, Shelly 1
Geitje
Posts: 170
Joined: Monday 22 January 2018 21:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to control my gate from my smartphone

Post by Geitje »

Domoticz beta, on Raspberry Pi 3B, Raspian Buster
Zwave, Zigate, RFlink etc.
julienjan
Posts: 18
Joined: Saturday 18 May 2019 17:51
Target OS: NAS (Synology & others)
Domoticz version: 4.9700
Location: France, Bretagne
Contact:

Re: How to control my gate from my smartphone

Post 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.
Domoticz v4.9700 on NAS Synology DS115j, RFLink on Arduino Mega 2560 (nodo-shop.nl) controlling Somfy RTS blinds, Shelly 1
Geitje
Posts: 170
Joined: Monday 22 January 2018 21:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to control my gate from my smartphone

Post by Geitje »

Nice one. You do not mention if it works, but I suppose it does?
Domoticz beta, on Raspberry Pi 3B, Raspian Buster
Zwave, Zigate, RFlink etc.
julienjan
Posts: 18
Joined: Saturday 18 May 2019 17:51
Target OS: NAS (Synology & others)
Domoticz version: 4.9700
Location: France, Bretagne
Contact:

Re: How to control my gate from my smartphone

Post 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
Domoticz v4.9700 on NAS Synology DS115j, RFLink on Arduino Mega 2560 (nodo-shop.nl) controlling Somfy RTS blinds, Shelly 1
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest