Door Camera

If you don't know where to post, post here.

Moderators: marcelr, TheHogNL, Toonz

oepi-loepi
Advanced Member
Advanced Member
Posts: 628
Joined: Sat Feb 09, 2019 7:18 pm

Door Camera

Post 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....??
Toonz
Forum Moderator
Forum Moderator
Posts: 1871
Joined: Mon Dec 19, 2016 1:58 pm

Re: Door Camera

Post 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.
member of the Toon Software Collective
oepi-loepi
Advanced Member
Advanced Member
Posts: 628
Joined: Sat Feb 09, 2019 7:18 pm

Re: Door Camera

Post 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.
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Door Camera

Post by TheHogNL »

You could also try to port this to the Toon https://gist.github.com/apk/2414478
Member of the Toon Software Collective
Toonz
Forum Moderator
Forum Moderator
Posts: 1871
Joined: Mon Dec 19, 2016 1:58 pm

Re: Door Camera

Post 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.
member of the Toon Software Collective
oepi-loepi
Advanced Member
Advanced Member
Posts: 628
Joined: Sat Feb 09, 2019 7:18 pm

Re: Door Camera

Post 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).
Toonz
Forum Moderator
Forum Moderator
Posts: 1871
Joined: Mon Dec 19, 2016 1:58 pm

Re: Door Camera

Post 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
member of the Toon Software Collective
oepi-loepi
Advanced Member
Advanced Member
Posts: 628
Joined: Sat Feb 09, 2019 7:18 pm

Re: Door Camera

Post 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.
Xavier
Member
Member
Posts: 174
Joined: Wed Jan 16, 2019 1:40 am

Re: Door Camera

Post 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!!
Toon2 with 6.0.2 firmware TSC 2.1.7
Apps: Sonos, Calender, garbagecalender, webcam, doorcam, Onkyo, Domoticzboard, Solar and weather app.
oepi-loepi
Advanced Member
Advanced Member
Posts: 628
Joined: Sat Feb 09, 2019 7:18 pm

Re: Door Camera

Post 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")
Attachments
doorcam-1.0.0.zip
(42.53 KiB) Downloaded 551 times
maikelvds
Starting Member
Starting Member
Posts: 18
Joined: Tue Jan 16, 2018 8:54 pm

Re: Door Camera

Post by maikelvds »

Really great! Thanks!
roykaandorp
Starting Member
Starting Member
Posts: 8
Joined: Tue Apr 24, 2018 11:42 pm

Re: Door Camera

Post 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?
Toonz
Forum Moderator
Forum Moderator
Posts: 1871
Joined: Mon Dec 19, 2016 1:58 pm

Re: Door Camera

Post 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)
member of the Toon Software Collective
roykaandorp
Starting Member
Starting Member
Posts: 8
Joined: Tue Apr 24, 2018 11:42 pm

Re: Door Camera

Post 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
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Door Camera

Post 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.
Member of the Toon Software Collective
Post Reply

Return to “Toon miscellaneous”