Vistacam API

It would be great to confirm if WebRTC is being used. Embedding VLC is another option as it handles RTSP streams. If you install VLC and open a URL such as rtsp://192.168.1.176:5554/63fd4ae9077e90123b60d64f you can see the camera stream.

It’s possible to embed this into a web page too (which maybe what is being used? [not sure] in Mios dashboard).

Yes, I got that from the Mios (Ezlo) dashboard page.


The app I am working on is something I’ve been working on for a couple of years as a side hobby.
I essentially wanted a home automation system that was extremely simple to set and use.

I started with the earlier Vera hubs, and then moved to Ezlo due to its rich API. Visually, it has similarities to the Mios dashboard (first time I saw the dashboard was today when you sent a link - didn’t realize that existed).

It’s fully web-based so works on a desktop, phone, iPad. You still need the Vera app to add / pair devices, this is more for orchestration of those devices.

There’s no shortage of other apps (Home Assistant for example), but the difference with this one is the simplicity. Some users want to control everything with lots of plug-ins and features, etc., and that’s fine, but others want something that is easy to set-up and use. That’s my goal. Plus it keeps my brain busy.

It is easy to create schedules, actions, etc., It also supports virtual hubs, so for example you can have up to three physical hubs show up as one virtual hub. This is useful for when you have a hub in your home, and another in another building such as a workshop.

Any device can trigger actions for any other device on any hub. For example, if you lock your front door, the lights can turn off. It you turn on your lights, you can unlock your front door. A leak can make a light blink, send you a text message, or audibly tell you (Mac only currently) there is a leak.

The dashboard is update in realtime, so if you physically turn on a light (for example), it will show as on on the web page - same for motion, leaks, etc.

It has a powerful rules engine where you can write rules in plain language. For example, let’s say you want to turn on your porch lights when motions is detected. The Rule might be:

Front Door MS1 detects motion

and the action is:

Turn On Home.Front Porch Light
Wait 5 Minutes
Turn Off Home.Front Porch Light

(Home is one of my hub names.)

This is a trivial example, but you get the idea. You can restrict actions to time of day, location, etc. For example, only turn on lights on motion if it’s nighttime.

It uses WebSockets so it’s fast! You can “say”:

Turn On All Lights

and it’s almost instant. I’ll share more shortly once I’ve wrapped up a few more items. The plan is for it to be free for anyone that wants to use it. It’s not going to rival others in terms of device support, but for what it does support (lights, locks, sensors, colored lights, etc,) it works petty well. (It’s been running my house for a few years now).

I’ll include a few screen shots so you can see how it looks.

Collapsed dashboard:

Action Editor

Theme editor (to create custom looks).

Full dashboard showing a color changing bulb being updated

Schedule editor showing lights turning on 5 minutes after sunset.

2 Likes

A senior dev just said

“we are working on improving the existing webrtc structure. After that work is done we can take this into consideration. We need to check if it can be done”.

In relation to your question about it.

Wow that web app looks very good ! Definitely interested to learn more about it.

Regarding Ezlogic which is Ezlo’s own web app they are developing, they have a dashboard page as you have seen today. The customisation of that dashboard is not so easy however, but they are working on a new dashboard designer I’ve been told.

They are also developing a rules logic engine called Meshbots, which you can also take a look at in their web page.

Personally I am still using Multi System Reactor logic engine, which supports various hubs and brings them together, like Vera and Ezlo hubs and Hubitat and Home Assistant also.

As for a dashboard page I am using an app called “Home Remote” but that doesnt support Ezlo hubs. It supports Vera hubs and some other platforms like Home Assistant etc.

Thanks. This will be a single app with a unified dashboard, simple rules engine, scheduler and device control - all in one. It also has a built-in WebSockets server and HTTP server so a simple set-up with very little to install. I’ll keep you posted… hopefully a release shortly.

Thank you. I appreciate that.

In the meantime, is there somewhere I can get the key from my set-up so I can continue testing? I’m happy to hardcode it for now until another option is possible.

I’m able to initiate the snapshot, I can see it in the Vera app, now I just need to be able to grab it.

Thanks. As they consider the architecture, it would be very nice to have a local option, epscially considering that the cameras seem to have SD cards in them?

Having to go to the cloud for images / video defeats the point of being able to use the controller only locally. A lot of users don’t want to rely on the cloud due to privacy, latency concerns. That’s really one of the great things about the Vera / Ezlo controllers - being able to do things locally. The speed improvements alone are significant.

If this could be passed along, that would be appreciated.

There was an SD card supplied with my VistaCam Doorbell unit, so presumably it stores some content locally on the SD card.

How to access it is another matter however as you say.

@Alvaro_Ochoa In the meantime, is there somewhere I can get the key from my set-up so I can continue testing? I’m happy to hardcode it for now until another option is possible?

Thanks.

Hi

Also is it only possible to get an RTSP stream off the VistaCam ?

No MJPEG or Snap Shot JPG streams available ?

Thanks

Hi - just following up… can you share that key information? Thanks @Alvaro_Ochoa

Good morning @Alvaro_Ochoa. Any update on this? (It’s been a couple of weeks since I asked and can’t move forward until there is a resolution).

The Vera and web dashboard both show the camera snapshot, so there must be a way to get the image?

Thanks

Hi @robotman

Here is how to get the user/pass for Ezlo Vistacams:

  1. Set your controller to debug mode and log level 4

  2. Try starting a recording on the cam, taking a snapshot or change settings …
    This will produce debug level logs on hub

  3. Access hub via ssh or sftp and check logs file tmp/log/firmware/ha-luad.log
    You should see user and pass in the full rtsp URL


    You can also see which CGI commands are used on the API locally

  4. You can use this API call to get the stream directly from the camera
    http://ip address:port/cgi-bin/CGIStream.cgi?cmd=GetMJStream&usr=xxx&pwd=xxx
    There is also “snapPicture” command to take snapshot I believe. It can save to local sd card or upload to ftp.

Thanks - I’ll look into this. What are the default credential to SSH into the Ezlo hub?

user is root and use the wifi password off the sticker

Perfect. Thank you.

I changed the log levels as indicated, and SSH’d into the hub. I’m not seeing any of the info you mention in ha-luad.log.

Here are the last few lines, representative of what I’m seeing…

root@HUB90004084:/tmp/log/firmware# tail -f ha-luad.log

LUA: Attribute value updated: node_id: 14099

2023-03-17 13:25:09.260864 INFO : LuaAddon: a script: HUB:zigbee/scripts/events/zigbee/events_handling has been executed successfully

LUA: Attribute value updated: node_id: 14099

2023-03-17 13:25:09.323149 INFO : LuaAddon: a script: HUB:zigbee/scripts/events/zigbee/events_handling has been executed successfully

2023-03-17 13:25:44.398034 INFO : LuaAddon: a script: HUB:foscam/scripts/functions/check_reachable_status has been executed successfully

2023-03-17 13:25:44.633473 INFO : LuaAddon: a script: HUB:foscam/scripts/functions/foscam_http_request has been executed successfully

2023-03-17 13:25:44.640862 INFO : LuaAddon: a script: HUB:foscam/scripts/functions/foscam_http_request has been executed successfully

2023-03-17 13:26:44.397479 INFO : LuaAddon: a script: HUB:foscam/scripts/functions/check_reachable_status has been executed successfully

2023-03-17 13:26:44.654065 INFO : LuaAddon: a script: HUB:foscam/scripts/functions/foscam_http_request has been executed successfully

2023-03-17 13:26:44.662831 INFO : LuaAddon: a script: HUB:foscam/scripts/functions/foscam_http_request has been executed successfully

I can see a live stream in the dashboard. When I wave my hand in front of the camera, the last few lines of the log file are:

2023-03-17 13:32:30.066699 INFO : LuaAddon: a script: HUB:foscam/scripts/handlers/foscam_events_handler has been executed successfully

2023-03-17 13:32:30.079620 INFO : LuaAddon: a script: HUB:foscam/scripts/handlers/foscam_events_handler has been executed successfully

2023-03-17 13:32:31.182092 INFO : LuaAddon: a script: HUB:zwave/scripts/model/gateway/events_handling/events_handling has been executed successfully

Binary sensor value updated, node id: 13, channel id: 0, class id: 48

2023-03-17 13:32:31.201346 INFO : LuaAddon: a script: HUB:zwave/scripts/events/events_handling has been executed successfully

2023-03-17 13:32:31.385030 INFO : LuaAddon: a script: HUB:zwave/scripts/model/gateway/events_handling/events_handling has been executed successfully

Unknown notification received, node id: 13, channel id: 0, class id: 0x71, v1_alarm_type: 0x00, v1_alarm_level: 0x00, notification_type: home_security, event_type: 0x08

2023-03-17 13:32:31.427046 INFO : LuaAddon: a script: HUB:zwave/scripts/events/events_handling has been executed successfully

2023-03-17 13:32:35.070731 INFO : LuaAddon: a script: HUB:foscam/scripts/items/motion has been executed successfully

2023-03-17 13:32:44.397148 INFO : LuaAddon: a script: HUB:foscam/scripts/functions/check_reachable_status has been executed successfully

2023-03-17 13:32:49.406198 ERROR: R: 28 - Error <foscam:6414ce6c077e9012c2018384>, http code: 0

2023-03-17 13:32:49.406492 ERROR: Connection error: <foscam:6414ce6c077e9012c2018384>: 'Connection timed out after 5003 milliseconds'

2023-03-17 13:32:49.406682 ERROR: emitConnectionClosed: event.http_connection_closed.httpStatus not set, some other Http status: 6

2023-03-17 13:32:49.407116 ERROR: clearQueue: No connection to remove found in a plugin queue: (foscam, 6414ce6c077e9012c2018384)

2023-03-17 13:32:49.408542 ERROR: foscam: Request failed with error: Timeout of response is reached

2023-03-17 13:32:49.409817 INFO : foscam: Device 63fd4ae3077e90123b60d622 is now unreachable

2023-03-17 13:32:49.446959 INFO : foscam: Updating child devices of "VistaCam" to false

2023-03-17 13:32:49.457622 INFO : foscam: Check if any device IP has changed

2023-03-17 13:32:49.462624 INFO : foscam: Broadcast Search Request command

2023-03-17 13:32:49.464066 INFO : LuaAddon: a script: HUB:foscam/scripts/functions/foscam_http_request has been executed successfully

2023-03-17 13:32:49.466467 INFO : LuaAddon: a script: HUB:foscam/scripts/functions/udp_discovery has been executed successfully

2023-03-17 13:32:49.467457 INFO : LuaAddon: a script: HUB:foscam/scripts/handlers/core_events_handler has been executed successfully

2023-03-17 13:32:49.487168 INFO : foscam: Processing camera_diagnostic (63fd4ae9077e90123b60d64f) for: camera_packet_delay

2023-03-17 13:32:49.493102 INFO : LuaAddon: a script: HUB:foscam/scripts/handlers/cameras_events_handler has been executed successfully

2023-03-17 13:32:49.494437 INFO : LuaAddon: a script: HUB:foscam/scripts/handlers/core_events_handler has been executed successfully

2023-03-17 13:32:49.495528 INFO : LuaAddon: a script: HUB:foscam/scripts/handlers/core_events_handler has been executed successfully

2023-03-17 13:32:49.501285 INFO : foscam: Received: MO_I

2023-03-17 13:32:49.502137 INFO : LuaAddon: a script: HUB:foscam/scripts/functions/udp_discovery has been executed successfully

2023-03-17 13:32:52.465477 INFO : foscam: UDP discovery complete

2023-03-17 13:32:52.465943 INFO : foscam: Call callback script: HUB:foscam/scripts/functions/check_reachable_status

2023-03-17 13:32:52.469642 INFO : LuaAddon: a script: HUB:foscam/scripts/functions/udp_discovery has been executed successfully

2023-03-17 13:33:01.311194 INFO : LuaAddon: a script: HUB:foscam/scripts/handlers/foscam_events_handler has been executed successfully

2023-03-17 13:33:01.318138 INFO : LuaAddon: a script: HUB:foscam/scripts/handlers/foscam_events_handler has been executed successfully

2023-03-17 13:33:14.499115 INFO : LuaAddon: a script: HUB:foscam/scripts/items/camera_diagnostic has been executed successfully

Any thoughts?

Thanks.

(Note: I can see some credentials in the ha-webrtcd.log file:

[info][2023-03-17.13:42:30] SPClient Received MSG====>>>{"responseBody":[{"_id":"64144dbf077e9012473be183","description":"high quality stream","pluginId":"foscam","rtspStreamStatus":"running","rtspUrl":"rtsp://admin:XXXXXXX@192.168.1.96:88/videoMain","streamId":"63fd4ae9077e90123b60d64f","streamName":"VistaCam"}],"uuid":"7295b593-980b-41c8-9762-f700ad9ba9ff"}

Where “XXXXXXX” is an encrypted password.

But, when I call the URL you mention with those:

http://192.168.1.96:88/cgi-bin/CGIStream.cgi?cmd=GetMJStream&usr=admin&pwd=XXXXXXX

I get “No MJ stream” in the browser.

You need to reboot the hub atfer changing to DEBUG logging level. For that level to then show within the logs

Thank you. I now see those lines. (Turns out the credentials are the same as those in ha-webrtcd.log which makes sense).

However, I’m still not able to get a stream using:

http://192.168.1.96:88/cgi-bin/CGIStream.cgi?cmd=GetMJStream&usr=admin&pwd=XXXX

No MJ stream

Although, even if I could, this is not going to work for regular users. Most users aren’t going to SSH into their hub, grep the log file for credentials, etc.

@Alvaro_Ochoa Will there be an easier API to get a snapshot and stream from these cameras? Something where a user only needs their Vera app / Mios dashboard credentials?

Thanks.

for foscam

That’s excellent. Thank you. Works perfectly, but there is still the issue of finding the username and password… it would be ideal if the request did not require a username and password and instead returned a UUID that could then be used to retrieve the image / stream. That way it would only be known by the requestor and could change every request making it more secure.

I should add, thanks to your post, I also found this PDF manual for the Foscam IP cameras. Extremely helpful.

snapPicture2 is very useful too.