Sure! I think I shared this before as well. here it is again. I did not use momentary switches. Instead I used a normal switch and set different preset for ON vs OFF. That way I could move the camera to different positions by toggling the switch.
def switchHandler(evt) {
log.debug “PAN Switch was turned ON or Off”
for(camera in cameras){
if (evt.value == "off"){
log.info "Camera has started panning"
camera.preset1()
log.info "Camera has set to preset1"
}
else if (evt.value == "on"){
camera.preset3()
log.info "Camera has set to preset2"
}
}
At this point, I can’t recommend this. Maybe it works better on iOS, but on Android, the interface is broken. Still has showstopping bugs despite being a paid product. Unless these issues get resolved, you’re better off saving your money and sticking with the free version here: Foscam Device Type
Presets and cruises display as ‘%s’. They’re setup correctly as clicking on them pans the camera.
Device page occasionally locks up and won’t scroll. Have to exit out of smartthings and restart.
Buttons don’t always work
Taking snaps doesn’t work (noted Android problem, but still an issue)
Alarm functionality not complete. Missing implementation of a few alarm functions for capability.alarm (both(), siren())
RBoy
(www.rboyapps.com - Making SmartThings Easy!)
66
@bgh10788, I had sent you an eMail in response to your note but I didn’t get a response so I’ll repost the questions here.
Can you provide a screenshot or let me know what you’re entering for the presets in the preferences page
The device page locking up is an Android app issue which will be fixed in the next release of ST Android (documented above). there is a workaround provided by @jody.albritton above which you can use
Button don’t “appear” to work is usually a sign of a connection issue. This can be hard to debug but if you’re consistently facing the issue we could help you isolate the issue
Thanks for letting me know about the missing functionality for the Alarm, I’ll look into it and fix it
Your feedback to these questions would be appreciated - it will help improve the software. nothing is perfect and you’re the first person to report the Alarm and %s issues (even on Android) and ofcourse the goal is to fix it.
RBoy
(www.rboyapps.com - Making SmartThings Easy!)
68
Thanks this was very helpful. I think I see what’s going on. It was designed to not accept a blank input and default back to “Horizontal” and “Vertical” for the default cruise names (which is what Foscam has also). So on the iOS it seems to work fine and default back but I see in your case the ST app isn’t validating it correctly and it’s showing “junk” instead of defaulting back.
I’ll fix this - thanks for reporting it.
Can you try putting something except for “blank” and let me know if it works so I can get a complete picture of what works and what doesn’t.
RBoy
(www.rboyapps.com - Making SmartThings Easy!)
69
@bgh10788 also try this, the way the device app is currently written - changes to the preferences are overwritten to the tile AFTER the refresh button is pressed or it receives a poll command (it’s a workaround which is on my todo to fix). After you make the changes to preferences (both with text and blank), press refresh and let me know what you see in both cases in the tiles. One thing I’m suspecting is that on Android a null is shown as %s (still a bug but I’m trying to isolate the root cause of your issue). thanks
RBoy
(www.rboyapps.com - Making SmartThings Easy!)
70
Okay I’ve fixed the issues related to the %s and the alarm type commands. Please try the latest code and let me know if fixes your issue. You will STILL need to press refresh for now to update the tiles after changing / setting the preferences. That I’ll fix in future as it requires a significant rewrite.
It looks like the the recent update for Android + your new code fixed a lot of the issues I was seeing. Seems more responsive, the names actually show up, and the “Take” actually shows a picture now. Only thing is, the text is extremely small for the cruises and presets. Also, I noticed that if you take a snap, the picture shows up fine, but if you take another one, you have to exit out of the device and go back in to actually see the new picture. Refresh doesn’t work. Maybe that’s an Android issue though.
RBoy
(www.rboyapps.com - Making SmartThings Easy!)
72
i’m glad to hear that and thanks for your patience.
Regarding the text size - that’s actually auto sized by the st app - I’ve tried many things but unfortunately ST doesn’t allow font size control yet. Infact it won’t even allow me to “split” the text in two lines unless I change the tile type which doesn’t look good. (it has circles like the LED tiles).
The best way to handle this would be reduce the number of characters in the text. The other thing I was debating is to remove the words “preset” and “cruise” from the tile but that would just confuse people to have the tile blank.
Here’s a thought, if the user doesn’t enter anything then it’ll show cruise1 preset1 etc. If you enter something that it will show exactly what you’ve entered (ie. it wont’ append cruise and preset). Does that sound better? I’m wondering if that would be confusing for users without the appended text.
I paid the $10 to get access to the RBoy SmartApps Server. I think your Foscam implementation is very good and I’ve finally been able to incorporate my 9805, 9821 and 9831 cameras into SmartThings successfully.
But here’s the one issue that is just killing it for me! Hopefully it’s something you can fix.
Every time the “alarm” is turned on (motion activation enabled) – and this happens for all of my Foscams – the custom detection area settings I have configured for each camera get wiped out. That is to say, I suspect something in your code is setting the entire camera view as a detection area. As a consequence I get a lot more alerts than I want, such as cars driving by on the street, etc. For this to work well for me, I need a way for my custom detection areas to be preserved when motion detection is enabled. Would this be possible to implement/fix?
Has anyone been able to set a custom device image with RBoy’s Foscam Device Type? I’ve performed Things > Camera > Preferences > Set Device Image and picked a photo from my camera roll (iPhone 6). It then appears in the Preferences screen, but after Done, it doesn’t show up on the Things screen. If you go back to the Preferences screen, the picked image is no longer there.
RBoy
(www.rboyapps.com - Making SmartThings Easy!)
75
@KakaduDreamer, glad it’s working. That’s correct, when the motion detection is setup via the foscam device type it basically enabled the entire screen detection and not any zones. The primary reason being that one can’t replicate the user interface for the foscam device to select the zones. However I can see your issue and let me look into what can be done.
One possible quick fix can be if the user can enter the zone command. That will entail you figuring out your current configured zones from the URL and entering that information in the device type. Can you do that?
RBoy
(www.rboyapps.com - Making SmartThings Easy!)
76
BTW @bgh10788 with the recent Smarthings mobile app update, now it enlarges the text by making it multi line. So the net effect I see on the text size is that it’s larger and more readable. I guess someone from ST is reading the threads
I ran into that with @jody.albritton’s code above as well. To get your config, you can access the camera’s api (after setting the alarm areas in the camera’s web interface)
@kevintierney Thank you! Your solution seems to work for me. I had to modify the code somewhat to also check the unique port number to determine which of the 4 different Foscam cameras I’m enabling the alarm for because each has their own unique motion detect areas and sensitivity levels. I need to test this further but this does seem to be honoring my customized motion detection areas…
If you aren’t going to use the arm/disarm functionality, you can set up a separate view only account, but obviously the password will still be sent clear text
@ehoffman73 If I may, how exactly did you get your Foscam into the Action DShboard? I’m a little confused on the dashboard. Do I add it as a “thing” in the ST app first? In the IDE, and if so, how? I’ve tried searching and quite frankly there are so many posts it’s hard to find a starting point. Many thanks in advance.
What I did was go in the SmartThings mobile app My Apps section, I went to my Action Dashboard setup, click the gear to start editing, and then chose Video streams. Then chose generic MPJPEG video streams. Then I filled in my details in this format:
I got the IP address from my FOSCAM app I had downloaded from the app store so I verified the cam was working…and once I put in the right details it showed up in the dashboard!