Page 1 of 1

Aldi IP camera (Maginon PIC1a): test works, video works, but no snapshots after that...

Posted: Tuesday 26 February 2019 16:16
by pgielen
I have set up my old Aldi IP security camera (a Maginon IPC 1a) which still works fine with Domotiz, by adding it with the following parameters:

Camera enabled: checked
Name: Frontdoorcam
Protocol: HTTP
IP address: <Camera IP address)
Port: 80
Username: <left blank>
Password: <left blank>
ImageURL: snapshot.cgi?user=USERNAME&pwd=PASSWORD

BTW I have to add username and password in the url; if I fill these in in Username and Password fields, it does not work.

So with these settings, I can click the Test button and take a snapshot. And if I save, return to the Domoticz camera list and then click on 'Stream Video', I see video. But if I click on 'Take picture' in this list, a blank screen is opened with the URL <Domoticz address:Port>/camsnapshot.jpg?idx=1. So where has the picture gone? Does the Take Snapshot button work differently from the Test button?

I also added a front door sensor to the Cam Devices list, triggering the sensor does not take a picture. According to the log file, the sensor is triggered just fine, but the camera does not show up in the log at all.

Is there some setting that I overlooking?

Re: Aldi IP camera (Maginon PIC1a): test works, video works, but no snapshots after that...

Posted: Saturday 02 March 2019 11:20
by hoeby
please post your script, maybe we can help
i have this working with the xiaomi hacked cam and with some axis camera's. Works just fine.
also post on which kind of device you are running domoticz

Re: Aldi IP camera (Maginon PIC1a): test works, video works, but no snapshots after that...

Posted: Sunday 03 March 2019 10:17
by pgielen
I have no script, just added the setting in Domoticz > Settings > More Options > Cameras, where I have added an active device (Switch Frontdoor Sensor, when: On, Delay: 0). That doesn't work.

It would be ideal if I could take a photo (or a series of photos) when someone opens the door and send it (or send the link to it) as a Pushover notification to my phone. Can you tell me how to let the Aldi camera take a photo through a dzvents script?

Re: Aldi IP camera (Maginon PIC1a): test works, video works, but no snapshots after that...

Posted: Sunday 03 March 2019 14:03
by hoeby
I don't send with pushover, but with telegram.
Here is the DZvents code i use, it works on Linux (Pi), because 'wget' and 'curl' are Linux commands.
The camera doesn't have to be configured in domoticz
What do you need to fill in:
- The device which triggers the script
- your telegram token
- your telegram chat id
- the string of the camera, for getting the camera image (the local domoReq line). The string in my example is for axis camera's, for your camera this is different.

Code: Select all

return {
    on = { 
       devices = {'Camera voordeur'},
    },

    execute = function(domoticz, device)
        if(device.state == 'On') then
            local teleTok   = 'Your telegram token'
            local chatId    = 'Your telegram chatID'
            local snapFile  = '/home/pi/domoticz/scripts/camera_'
            local domoReq   = 'http://XXX.XXX.XXX.XXX/jpg/1/image.jpg'
            local camName   = 'Voordeur'
            os.execute('wget -O "'..snapFile..camName..'.jpg" "'..domoReq..'"')
            os.execute('curl -s -X POST "https://api.telegram.org/bot'..teleTok..'/sendPhoto?chat_id='..chatId..'" -F photo="@'..snapFile..camName..'.jpg"')
            os.execute("rm " ..snapFile..camName..'.jpg')
        end
    end
}

Using pushover, you need to modify the scripts.
On the pushover website, i found this. Maybe a start to modify
The 'wget' command line stays the same, this is for getting a snapshot.
The 'curl' needs to be different, this is de command line for sending the image.
When DZvents modification doesn't work, you also can put in a .sh file and add the line in scripts on/off of your device

Code: Select all

curl -s \
--form-string "token=APP_TOKEN" \
--form-string "user=USER_KEY" \
--form-string "message=here is an image attachment" \
-F "attachment=@/path/to/your/image.jpg" \
https://api.pushover.net/1/messages.json

Re: Aldi IP camera (Maginon PIC1a): test works, video works, but no snapshots after that...

Posted: Monday 04 March 2019 12:13
by pgielen
Thanks, I'll give this a try!