Page 2 of 3

Re: Door Camera

Posted: Mon Sep 02, 2019 11:54 pm
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?

Re: Door Camera

Posted: Tue Sep 03, 2019 9:47 am
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 :)

Re: Door Camera

Posted: Tue Sep 03, 2019 10:09 am
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" ?

Re: Door Camera

Posted: Tue Sep 03, 2019 12:25 pm
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.

Re: Door Camera

Posted: Wed Sep 04, 2019 8:01 pm
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?

Re: Door Camera

Posted: Thu Sep 05, 2019 5:02 pm
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!! :)

Re: Door Camera

Posted: Thu Sep 05, 2019 8:59 pm
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

Re: Door Camera

Posted: Thu Sep 05, 2019 11:07 pm
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!

Re: Door Camera

Posted: Mon Sep 09, 2019 11:01 pm
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!

Re: Door Camera

Posted: Sun Sep 15, 2019 12:15 pm
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

Re: Door Camera

Posted: Sun Sep 15, 2019 2:49 pm
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

Re: Door Camera

Posted: Wed Sep 18, 2019 11:59 am
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?

Re: Door Camera

Posted: Wed Sep 18, 2019 6:55 pm
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.

Re: Door Camera

Posted: Thu Sep 19, 2019 11:05 am
by Micha_123
How can i do that?

Re: Door Camera

Posted: Thu Sep 19, 2019 11:50 am
by Toonz
someone needs to code that, best to ask oepi-loepie, it is his app.......