Door Camera

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

Moderators: marcelr, TheHogNL, Toonz

Xavier
Member
Member
Posts: 174
Joined: Wed Jan 16, 2019 1:40 am

Re: Door Camera

Post by Xavier »

Picking up this post again.
Trying to get this to work.
I uploaded the folder "doorcam" to /qmf/qml/apps
I set the right webcam url + domoticz URL + IDX + VAR.

In domoticz I created via Setup -->More Options --> Events a new script/event
The name is "ShowDoorCamToon"
I exactly created the if do statement.
I saved the script with trigger "User variable" (is this ok?)

One other question:
What does the variable "SendtoToon"means?
What does this variable? What is behind this? What should it do?
Toon2 with 6.0.2 firmware TSC 2.1.7
Apps: Sonos, Calender, garbagecalender, webcam, doorcam, Onkyo, Domoticzboard, Solar and weather app.
mAiden
Member
Member
Posts: 330
Joined: Mon Jul 10, 2017 10:22 am

Re: Door Camera

Post by mAiden »

SendToToon is a variable, if this one is set to 1, then Domoticz will be send it to Toon.
If this one is set to 0, Domoticz won't send it to Toon :)
Member of the Toon Software Collective
Xavier
Member
Member
Posts: 174
Joined: Wed Jan 16, 2019 1:40 am

Re: Door Camera

Post by Xavier »

mAiden wrote:SendToToon is a variable, if this one is set to 1, then Domoticz will be send it to Toon.
If this one is set to 0, Domoticz won't send it to Toon :)
Do you mean as an user variable, like the "ShowDoorCamToon"?
What would be the setup of this?
Is the Variable type then "String"?
Is the Variable Value then "0" ?
Toon2 with 6.0.2 firmware TSC 2.1.7
Apps: Sonos, Calender, garbagecalender, webcam, doorcam, Onkyo, Domoticzboard, Solar and weather app.
mAiden
Member
Member
Posts: 330
Joined: Mon Jul 10, 2017 10:22 am

Re: Door Camera

Post by mAiden »

Do you mean as an user variable, like the "ShowDoorCamToon"?
yes
What would be the setup of this?
dontknow, don't use this one. Im been on Home Assistant for a few months now, only know what I know about 4 years of Domoticz.
Is the Variable type then "String"?
yes
Is the Variable Value then "0" ?
0 or 1. By 1 it will be send to Toon. By 0 it dont send it to Toon.
Member of the Toon Software Collective
Xavier
Member
Member
Posts: 174
Joined: Wed Jan 16, 2019 1:40 am

Re: Door Camera

Post by Xavier »

Today I found some time to try and test but with no succes.
When triggering my doorbell I see this in the logging:
2019-09-04 19:46:34.087 Status: User: Admin initiated a switch command (143/Kaku Deurbel/On)
2019-09-04 19:46:34.089 Status: RFLink Sending: 10;NewKaku;14ea2b6;c;ON;
2019-09-04 19:46:35.074 (RFLink Gateway USB) Light/Switch (Kaku Deurbel)
2019-09-04 19:46:35.413 EventSystem: Event triggered: ShowDoorCamToon_1
2019-09-04 19:46:35.308 Status: Executing script: /usr/local/domoticz/var/scripts/deurbel.sh
2019-09-04 19:46:55.418 Status: Set UserVariable ShowDoorCamToon = 100

But nothing on my Toon happens. There is no pop-up.
What am I doing wrong?
Attachments
showdoorcamtoon-script-as-bloc.png
showdoorcamtoon-script-as-bloc.png (82.79 KiB) Viewed 7180 times
Toon2 with 6.0.2 firmware TSC 2.1.7
Apps: Sonos, Calender, garbagecalender, webcam, doorcam, Onkyo, Domoticzboard, Solar and weather app.
mAiden
Member
Member
Posts: 330
Joined: Mon Jul 10, 2017 10:22 am

Re: Door Camera

Post by mAiden »

Xavier wrote:Today I found some time to try and test but with no succes.
When triggering my doorbell I see this in the logging:
2019-09-04 19:46:34.087 Status: User: Admin initiated a switch command (143/Kaku Deurbel/On)
2019-09-04 19:46:34.089 Status: RFLink Sending: 10;NewKaku;14ea2b6;c;ON;
2019-09-04 19:46:35.074 (RFLink Gateway USB) Light/Switch (Kaku Deurbel)
2019-09-04 19:46:35.413 EventSystem: Event triggered: ShowDoorCamToon_1
2019-09-04 19:46:35.308 Status: Executing script: /usr/local/domoticz/var/scripts/deurbel.sh
2019-09-04 19:46:55.418 Status: Set UserVariable ShowDoorCamToon = 100

But nothing on my Toon happens. There is no pop-up.
What am I doing wrong?
ShowDoorCamToon is set to 100.. That means: If result is "100" then the camera app is closed (hidden).
ShowDoorCamToon must be set to 200, then Toon will be show it full screen!! :)
Member of the Toon Software Collective
Xavier
Member
Member
Posts: 174
Joined: Wed Jan 16, 2019 1:40 am

Re: Door Camera

Post by Xavier »

mAiden wrote:
Xavier wrote:Today I found some time to try and test but with no succes.
When triggering my doorbell I see this in the logging:
2019-09-04 19:46:34.087 Status: User: Admin initiated a switch command (143/Kaku Deurbel/On)
2019-09-04 19:46:34.089 Status: RFLink Sending: 10;NewKaku;14ea2b6;c;ON;
2019-09-04 19:46:35.074 (RFLink Gateway USB) Light/Switch (Kaku Deurbel)
2019-09-04 19:46:35.413 EventSystem: Event triggered: ShowDoorCamToon_1
2019-09-04 19:46:35.308 Status: Executing script: /usr/local/domoticz/var/scripts/deurbel.sh
2019-09-04 19:46:55.418 Status: Set UserVariable ShowDoorCamToon = 100

But nothing on my Toon happens. There is no pop-up.
What am I doing wrong?
ShowDoorCamToon is set to 100.. That means: If result is "100" then the camera app is closed (hidden).
ShowDoorCamToon must be set to 200, then Toon will be show it full screen!! :)
For testing purpose I set all on 200 but no reaction/popup on Toon
Toon2 with 6.0.2 firmware TSC 2.1.7
Apps: Sonos, Calender, garbagecalender, webcam, doorcam, Onkyo, Domoticzboard, Solar and weather app.
Xavier
Member
Member
Posts: 174
Joined: Wed Jan 16, 2019 1:40 am

Re: Door Camera

Post by Xavier »

I got it fxed!

So for everybody who is looking for this to work see instruction below.
Startingpoint is you already have automated your doorbell in Domoticz as a trigger.

Step 1:
Download the doorcam app on the first page of this thread

Step 2:
Unzip files

step 3:
Rename folder to "doorcam"

Step 4:
Copy folder to Toon in folder: /qmf/qml/apps

Step 5:
Reboot Toon

Step 6:
After reboot, on Toon add a Tile by clicking on "Tegel toevoegen" under "Algemeen" you will now see the tile "doorcam", click on it to add the tile

Step 7:
Open Domoticz, go to Setup--> more options --> User variables
Add a new variable with the following information:
Variable Name: ShowDoorCamToon
Variable type: String
Variable value: 150

Add a second variable with the following information:
Variable Name: SendtoToon
Variable type: String
Variable value: 0

Step 8:
In Domoticz go to setup --> more options --> events
Click on the "+" To add an automation script
Select "Blockly"
Now rebuild the "if-do statement" like in the screenshot on page 1 of this thread.

UPDATE 17-12-2019: You can also use a dzVents script instead of Blockly:

Code: Select all

return 
{
    on = 
    {
        devices = 
        {
            'Deurbel',
        },
    },

    logging = 
    { 
        level = domoticz.LOG_DEBUG,
        marker = 'Deurbel',
    },

    execute = function(dz, item)
        if item.active then 
            dz.log('Device ' .. item.name .. ' was pushed', dz.LOG_DEBUG)

            local sendToToon = dz.variables('SendtoToon')
            local showDoorCamToon = dz.variables('ShowDoorCamToon')

            if sendToToon.value == '0' then
                showDoorCamToon.set('200')  
                showDoorCamToon.set('100').afterSec(30)
                sendToToon.set('1')
                sendToToon.set('0').afterSec(30)
            end
       end
    end
}
Step 9:
Open with, for example, WINSCP the folder doorcam on your Toon

Step 10:
Edit the file "Variables1.txt" with your specs.
Change {"camURL" : "URL+COMMAND for your doorcam", "domURL":"http://DOMOTICZ IP:DOMOTICZ PORT", "idx":"IDX number of the created User Variable ShowDoorCamToon in Domoticz", "var":"ShowDoorCamToon"}
Save the file (make sure it is saved on your Toon and not local)

Step 11:
Edit the file "selectedImageURL1.txt"
Change "http://admin:sateliet@192.168.10.188/snap.jpg" to URL+COMMAND for your doorcam (the same as in step 10)
Save the file (make sure it is saved on your Toon and not local)

Step 12:
Edit the file "DoorcamApp.qml"
Look for the rows where:
property string doorcamImageURL1 : "URL+COMMAND for your doorcam"
property string domoticzURL1 : "http://DOMOTICZ IP:DOMOTICZ PORT"
property string domoticzIDX : "IDX number of the created User Variable ShowDoorCamToon in Domoticz"
property string domoticzVAR : "ShowDoorCamToon"
Save the file (make sure it is saved on your Toon and not local)

Step 13:
Reboot Toon again.

Step 14:
Test by triggering the doorbell

If all steps are followed correctly you should now see an image of your doorcam on Toon as pop-up.

First time I had the issue that there was no pop-up.
On Toon ga to the tile and click on doorcam. Go to "Configuratie" and validade if the settings are correctly like in Domoticz.
Somehow the settings were not saved.

One thing I changed was the duration of the popup screen instead of 20 seconds to 30 seconds.

Good luck!
Last edited by Xavier on Wed Dec 18, 2019 12:03 am, edited 1 time in total.
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 »

After a long long time i took a look at this topic i have started a long time ago. Xavier figured it all out. Thanks for the walk-through!
Micha_123
Starting Member
Starting Member
Posts: 39
Joined: Mon Sep 09, 2019 6:51 pm

Re: Door Camera

Post by Micha_123 »

nice its working, is it possible to stretch video to 16:9

my camera is 720P but makes screenshots in 704x576

stretch to 16:9 wil be realy nice
Toonz
Forum Moderator
Forum Moderator
Posts: 1871
Joined: Mon Dec 19, 2016 1:58 pm

Re: Door Camera

Post by Toonz »

Micha_123 wrote:nice its working, is it possible to stretch video to 16:9

my camera is 720P but makes screenshots in 704x576

stretch to 16:9 wil be realy nice
can you edit DoorcamFullscreen.qml?

change 2 times:

Code: Select all

		fillMode: Image.PreserveAspectFit 
into:

Code: Select all

		fillMode: Image.PreserveAspectCrop
Haven't been able to test this as not having a doorcam myself ;-)

Kind regardz,

Toonz
member of the Toon Software Collective
Micha_123
Starting Member
Starting Member
Posts: 39
Joined: Mon Sep 09, 2019 6:51 pm

Re: Door Camera

Post by Micha_123 »

Nice i have fix it thank you.



Another question


If someone ring the doorbel
Toon shows first an old picture from camera and then it updates. Is that to fix? After reboot toonit shows the first time directly live picture, acter second bel i see first old picture (drom the first bell) ant then it updates the picture on live.


Is that to fix?
Toonz
Forum Moderator
Forum Moderator
Posts: 1871
Joined: Mon Dec 19, 2016 1:58 pm

Re: Door Camera

Post by Toonz »

I would say clear the source property of the image when going into dim state and fill it again when you open the screen.
member of the Toon Software Collective
Micha_123
Starting Member
Starting Member
Posts: 39
Joined: Mon Sep 09, 2019 6:51 pm

Re: Door Camera

Post by Micha_123 »

How can i do that?
Toonz
Forum Moderator
Forum Moderator
Posts: 1871
Joined: Mon Dec 19, 2016 1:58 pm

Re: Door Camera

Post by Toonz »

someone needs to code that, best to ask oepi-loepie, it is his app.......
member of the Toon Software Collective
Post Reply

Return to “Toon miscellaneous”