Please make sure that you measure all voltages before; I can just guarantee the numbers for my station!
Preparation of Siedle:
I picked the signal of the ring button and switch a small relay (in the pic is an huge one which will be changed) to bridge the Shelly SW contact. So the relay is switched by the 7 and c contact from the Siedle station. If somebody pushed the doorbell button, the 7/c would jump to 13.2VAC.
Shelly 1:
My rectifier delivers 12VAC and 9VDC and luckily, the Shelly 1 does work with the provided DC power.
Shelly 1 contact L (-) is connected to 9 (Siedle). One cable from the rectifier is directly delivering 9VDC + which is wired to N (+) (Shelly). Then, a small cable from L (-) is put to the relay and the output signal of relay to SW on the Shelly.
Relay:
As mentioned, the 7/c (13.2VAC) will switch the relay and bridge between the L (-) and SW.
Shelly settings:
I will skip explanations on how to get the Shelly into your network etc. I will just focus on the getting the Domoticz switch to work.
Under Settings:
Power on default mode - "ON" - Configure Shelly device to turn ON, when it has power
Button Type - Edge Switch - Set Shelly device to be "Edge" switch. Changes state on every hit
Timer:
Auto Off - When On - Turn Off After 5 seconds
I/O URL actions:
OUTPUT SWITCHED ON URL:
Enabled
192.168.178.47:8080/json.htm?type=command&parm=switchlight&idx=59&switchcmd=On
OUTPUT SWITCHED OFF URL:
Enabled
192.168.178.47:8080/json.htm?type=command&parm=switchlight&idx=59&switchcmd=Off
Domoticz:
I created a dummy device and added On/Off switch. Note the idx and adjust the idx switched URL above (also IP obviously). I was not able to work with the doorbell switch so if somebody of you got some ideas, would be happy to try/know.
Code (lua script/device) for sending note and pictures to Telegram:
I will also not go through the process of creating a Telegram bot. Hope you have a good reference or maybe some thread in the forum here.
Cameras, also here I assume you already got some cameras in your Domoticz system. Not sure how to get the idx from camera; I made try and error.
I found the script while watching an YouTube video and had to fine tune the POST string since I was not able to make it work using the local bot variable. Credit to HOUSEDOMOTICZ https://sites.google.com/view/housedomo ... authuser=0
Code: Select all
-- service data chat telegram
-- local bot = 'xxxxxxxxxx'; -- Telegram Bot ID
local token = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx; -- Telegram Bot Token
local chatId = 'xxxxxxxxx'; -- Telegram Chat ID
local message = 'Doorbell'; -- message subject
commandArray = {}
if (devicechanged['Doorbell'] == 'On') then -- example for sensor state
-- save snapshot in temporary location
os.execute('wget http://127.0.0.1:8080/camsnapshot.jpg?idx=4 && mv camsnapshot.jpg?idx=4 /var/tmp/snapshot4.jpg')
os.execute('wget http://127.0.0.1:8080/camsnapshot.jpg?idx=3 && mv camsnapshot.jpg?idx=3 /var/tmp/snapshot3.jpg')
-- send snapshot to Telegram
-- os.execute('curl -s -X POST "https://api.telegram.org/bot'..bot..':'..token..'/sendPhoto" -F chat_id='..chatId..' -F photo="@/var/tmp/snapshot.jpg " -F caption='..message..' ')
os.execute('curl -s -X POST "https://api.telegram.org/bot'..token..'/sendPhoto?chat_id='..chatId..'" -F photo="@/var/tmp/snapshot4.jpg"')
os.execute('curl -s -X POST "https://api.telegram.org/bot'..token..'/sendPhoto?chat_id='..chatId..'" -F photo="@/var/tmp/snapshot3.jpg" -F caption='..message..' ')
end
return commandArray
I will update the thread once I was able to use the ESP8266 just to see if I can save some space to put all into the existing Siedle housing.