Page 1 of 3

Door Camera

Posted: Sun Feb 10, 2019 8:27 pm
by oepi-loepi
I have connected my doorbell through a Wemos D1 mini board to my existing doorbell. When someone rings, a message is pushed by Domoticz to an app "Telegram". Works great. I also added the door camera to Toon so when i choose the camera tile i will see my door entrance.

Would it be possible to trigger the Toon from a http command to open the camera app? And from another http command to close the camera app?

In that case it will be possible that the camera shows all by itself when someone rings at the door.

I was searching all afternoon in the rooted linux files but maybe someone has it running already....??

Re: Door Camera

Posted: Sun Feb 10, 2019 9:19 pm
by Toonz
Not yet. Maybe in the future when we can compile the qt-gui executable ourselves, we hopefully can include the QtWebsockets module which allows qml applications to react on external triggers on certain TCP IP ports.
For now the only option is to write a camera app on Toon which queries domoticz every x seconds to check the status.

Re: Door Camera

Posted: Mon Feb 11, 2019 12:44 am
by oepi-loepi
Thanks for your answer. I can now stop looking in the software without any bad feelings. It just isn't there (yet). Hopefully there will be a nice websocket in the future. Indeed for now the only solution would be pulling trigger variables from a server (internal) like Domoticz server or something every .. seconds. Not too long, not too much.

Re: Door Camera

Posted: Mon Feb 11, 2019 10:14 am
by TheHogNL
You could also try to port this to the Toon https://gist.github.com/apk/2414478

Re: Door Camera

Posted: Mon Feb 11, 2019 10:45 am
by Toonz
TheHogNL wrote:You could also try to port this to the Toon https://gist.github.com/apk/2414478
it is just a piece of the puzzle, you will still need to be able to trigger qml events....
The QtWebsockets module is basically doing the same but fully integrated into the Qt (qml) environment.

Re: Door Camera

Posted: Mon Feb 11, 2019 2:02 pm
by oepi-loepi
Would it be possible to post a trigger file to Toon by ftp containing 'true' or 'false' which is read every x seconds by the camera app? In this case the app status will be triggered by the contents of the trigger file instead of a click event. I is a big puzzle i agree and i do not have all knowledge of linux and qml... (more VB6 and Javascript).

Re: Door Camera

Posted: Mon Feb 11, 2019 5:52 pm
by Toonz
oepi-loepi wrote:Would it be possible to post a trigger file to Toon by ftp containing 'true' or 'false' which is read every x seconds by the camera app? In this case the app status will be triggered by the contents of the trigger file instead of a click event. I is a big puzzle i agree and i do not have all knowledge of linux and qml... (more VB6 and Javascript).
that's easy, but not much different from Toon doing a http call to domoticz at regular intervals

Re: Door Camera

Posted: Tue Feb 12, 2019 12:08 pm
by oepi-loepi
Yesterday i did some qml with just a simple notepad from the Toon. It was the first time programming qml but must say that is is quite easy if you know some JavaScript.

This is what i have done so far (using the 1.0.4 Webcam app fom the ToonStore).

1. I added a new string variable to Domoticz "ShowDoorCamToon". Set to "150".
2. A new timer is created to the webcam widget (3 seconds).
3. Every timer instance a get HTTP is send to Domoticz requesting the variable status of "ShowDoorCamToon".
4. The result is JSON so JSON is parsed and the variable result.value is checked.
5. If result is "200" then the camera app is shown full screen on Toon.
6. After the camera app is full screen a get HTTP is send to Domoticz setting the value of "ShowDoorCamToon" to 150.
7. The widget is still checking the Domoticz variable "ShowDoorCamToon" every 3 seconds.
8. If result is "100" then the camera app is closed (hidden).

Next to do is to modify the config/setup screens.

I will keep you all informed and thanks for the basic ideas. They were really a great help allready.

Re: Door Camera

Posted: Mon Mar 18, 2019 10:25 pm
by Xavier
oepi-loepi wrote:Yesterday i did some qml with just a simple notepad from the Toon. It was the first time programming qml but must say that is is quite easy if you know some JavaScript.

This is what i have done so far (using the 1.0.4 Webcam app fom the ToonStore).

1. I added a new string variable to Domoticz "ShowDoorCamToon". Set to "150".
2. A new timer is created to the webcam widget (3 seconds).
3. Every timer instance a get HTTP is send to Domoticz requesting the variable status of "ShowDoorCamToon".
4. The result is JSON so JSON is parsed and the variable result.value is checked.
5. If result is "200" then the camera app is shown full screen on Toon.
6. After the camera app is full screen a get HTTP is send to Domoticz setting the value of "ShowDoorCamToon" to 150.
7. The widget is still checking the Domoticz variable "ShowDoorCamToon" every 3 seconds.
8. If result is "100" then the camera app is closed (hidden).

Next to do is to modify the config/setup screens.

I will keep you all informed and thanks for the basic ideas. They were really a great help allready.
Nice, looping forward to new developments! Looking for exactly the same!!

Re: Door Camera

Posted: Sat Apr 06, 2019 10:28 am
by oepi-loepi
For anyone who is looking for the same option (connect Toon to Domoticz to show a doorcam when a doorbell is triggered), i have made some tutorial.

I am not a programmer and only adapted the Webcam App from makkie2002 (viewtopic.php?f=99&t=12138&start=0). Because of i am not a programmer, please feel free to use the code or parts of it. Please do not expect any kind of other service or updates.

To find the snap link of your camera, visit ispyconnect.com.

How it works:

1. There must be added a new string variable to Domoticz "ShowDoorCamToon". Set this to "150".
2. A new timer is created to the webcam widget (3 seconds).
3. Every timer instance a get HTTP is send to Domoticz requesting the variable status of "ShowDoorCamToon".
4. The result is JSON so JSON is parsed and the variable result.value is checked.
5. If result is "200" (set by Domoticz when doorbell is rung) then the camera app is shown full screen on Toon.
6. After the camera app is full screen a get HTTP is send to Domoticz setting the value of "ShowDoorCamToon" to 150.
7. The widget is still checking the Domoticz variable "ShowDoorCamToon" every 3 seconds.
8. If result is "100" then the camera app is closed (hidden).

What to do to make it work:

There must be added a new string variable to Domoticz "ShowDoorCamToon". Set this to "150".
Image

Make sure that when the doorbell rings, the Domoticz variable will be set to "200".
Image

Configuration od the doorcam App in Toon:
"camURL" : this is the url of the camera to the snapshot (e.g. "http://admin:admin@192.168.10.188/snap.jpg")
"domURL" : this is the path to Domoticz including port (e.g. "http://192.168.10.186:8080)
"idx" : this is the number of the variable made in Domoticz (e.g. "27")
"var" : this is the name of the variable made in Domoticz (e.g. "ShowDoorCamToon")

Re: Door Camera

Posted: Mon Jul 01, 2019 9:32 pm
by maikelvds
Really great! Thanks!

Re: Door Camera

Posted: Wed Jul 10, 2019 7:38 pm
by roykaandorp
Really great! This was what I'm looking for, but somehow I can't get the tile visible.
I just unzipped it in os x, after that I first edited the variables and copied it by scp to Toon within the right directore (/qmf/qml/apps/) and after that a "shutdown -r now"
But it doesn't appear, I've also tried to unzip in linux and then scp to toon.
What am I missing?

Re: Door Camera

Posted: Wed Jul 10, 2019 9:25 pm
by Toonz
roykaandorp wrote:Really great! This was what I'm looking for, but somehow I can't get the tile visible.
I just unzipped it in os x, after that I first edited the variables and copied it by scp to Toon within the right directore (/qmf/qml/apps/) and after that a "shutdown -r now"
But it doesn't appear, I've also tried to unzip in linux and then scp to toon.
What am I missing?
Is the foldername 'doorcam' (no capitals)?
What is your firmware version? The app above works only on firmware 5 (can be adapted for version 4 of course)

Re: Door Camera

Posted: Wed Jul 10, 2019 9:30 pm
by roykaandorp
Toonz wrote:Is the foldername 'doorcam' (no capitals)?
Yes that fixed the problem indeed, thank you!
Tried that before I updated the (old) firmware, it didn't work then and forgot to try again

Re: Door Camera

Posted: Thu Jul 11, 2019 6:48 am
by TheHogNL
With older firmware you needed to change a file manually to allow to add a custom app. Since when the firmware uses resource file for the native Toon apps the custom files are automatically loaded if they are in the right place.