Control Ecobee thermostat via HomeKit - homekit

I'm an iOS developer and my app (AirCompare) controls a HomeKit-enabled thermostat based on the weather and other factors. A user has an Ecobee 4 and it occasionally behaves in unexpected ways. The Ecobee documentation...well, basically there isn't any.
Here's one example I discovered last year: The thermostat may be set to "Off", not heating or cooling, but changing the temperature set point will trigger the thermostat to change the mode to achieve that new set point. That's understandable but my Ecobee 3 does not change mode on its own, so it was a surprise.
Now somehow an Ecobee 4 under control of my app self-changed its mode to "Auto", and proceeded to turn on my user's furnace despite having the windows open to cool off the house. I'm not quite sure what triggered that.
Does anyone know where to find any references on this? This is the first thread on SO to include both "Ecobee" and "HomeKit", so I'm not super optimistic. Please surprise me!

I used esp32 here is the code file.
I am have not worked with Ecobee but I am sure it will help you.
Checkout here for further docs.

Related

Minmizing OpenGL app while preserving EGL Context results in HUGE PROBLEM

I'm using opengl es 3.0 API with the android studio ndk to create apps.
But I've encountered a very huge problem. I've created a demo app, all it does it change the background color of the screen from white to black and vice versa, every frame. And so when I go to minimize this app, I still see it rendering the background, mostly at the edges of the screen, and not in full color but still very strongly apparent. And it doesn't go away when I close the app, when I restart the device, or when I run "kill apps" on it. Only a factory data reset fixes the issue, so it's not easy for me to debug this.
This is the relevant code that I'm using for when the app is minimized and receives the APP_CMD_TERMINATE event:
eglMakeCurrent(engine->display,EGL_NO_SURFACE,EGL_NO_SURFACE,EGL_NO_CONTEXT);
eglDestroySurface(engine->display,engine->surface);
engine->display = EGL_NO_DISPLAY;
engine->surface = EGL_NO_SURFACE;
I've error checked that eglDestroySurface() is successful.
And I've put debugging messages in to make sure that the main draw loop is NOT executing when the app is minimized. But the problem persists and I don't know what to do about it. Thanks for any help.
UPDATE: well, no one has responded, and I still don't know what to do. Could it be related to threads?
UPDATE: Still can't determine what it is, but for some reason it's messing with the System UI. Willing to upload my entire source code somewhere if someone would be willing to go through this with me, as I'd really like to be able to continue working on my game engine.
Is it the "Strict Mode" developer option on the device settings, perhaps?
That one flashes the screen if an app is blocking.
It would explain why a factory reset changes behaviour.
The answer is not a solution here. The above comment by the user columbo was correct.
I've demoed switching from black to white at high framerates on 3 different android devices, and also my Linux Desktop, all via the openGL api, and it has exhibited this issue on all the devices. So what he said must be correct: this is a problem with LCD monitor technology itself. Interestingly, doing completely random colors does not cause this problem.

CGEventTap mouse event position overwrite only possible when running app as root user?

I am developing a macOS app which takes control of the cursor. I am using a CGEvent Tap and I am adding some arithmetic to the CGEvents in order to offset the final mouse position. Although the app is in principle working as expected, in some cases - more specifically: when running the app with certain popular illustration software and using a stylus pen - the app is producing some flickering 'ghost' positions for the mouse at its original location. The good thing is, this problem can be resolved when running the app while being logged in as root user. I have read quite some SO posts but this particular post addresses the issue best:
https://stackoverflow.com/a/9899901/5066660
As described in this post the issue is probably:
Unfortunately, the CGEventTapCreate() doc says:
Only processes running as the root user may locate an event tap at the point where HID events enter the window server; for other users, this function returns NULL.
Well the function is definitely not returning null because the tap is in effect. Also I tried all possible combinations of arguments for that function, but they all act the same. Further down in that post it is proposed to tackle the problem as follows:
Perhaps you can spin this functionality off into a separate process that has super-user permissions, leaving the rest of your app in normal user mode? I believe there's also a way to request root permissions for just a specific action taken by your program.
Now if this is a possible solution I would love to implement it! So my question is: how? I've stumbled upon running scripts with elevated permissions, but not just CoreGraphics code as for example an CGEventTap. Is this possible? Could anybody give me an example of how this could be accomplished, or any other solution to the problem?
All help is welcome, thank you very very much.
From Apple documentation:
Event taps receive key up and key down events if one of the following conditions is true:
- The current process is running as the root user.
- Access for assistive devices is enabled. In OS X v10.4, you can enable this feature using System Preferences, Universal Access panel, Keyboard view.
So giving the the application Accessibility rights solved it for me (no need to run as admin). This can be achieved System Preferences -> Security & Privacy -> Accessibility and add you program there.

How to track a customer only bug

Scenario:
A customer is reporting bugs in a near useless fashion "sometimes when i press button A it does not work".
There story is constantly changing every time you talk to them "button A seems to go wrong after pressing button B" "now button A goes wrong after pressing button C" "Button A goes wrong irrespective of buttons B and C it was all just coincidence"
I have a test rig in my office and can see button A working perfectly, i have never had any issue and cannot replicate the customers problem no matter how many times i try.
management are 120% sure the issue is in the code, no chance that the issue is with the customers button A hardware.
What steps can be taken to trace this issue ? What do you do to show you have covered all possible bases before informing management the code is not the problem and you cannot fix it.
Edit: the software is embedded firmware not an application running on a computer.
As your customer is on the other side of the world I'm guessing your office hours are different and that's what makes it difficult to see what they're doing remotely. If the office hours isn't an issue, then you could ask them to let you watch their screen whilst they attempt to reproduce the issue. Software which could help this remote viewing process includes:
Join.me (FREE)- http://join.me
LogMeIn - https://secure.logmein.com/
GoToAssist - http://www.gotoassist.co.uk/remote_support/
amongst others.
If remote viewing isn't a possibility, another option might be to ask them to record the process, by using Steps Recorder (this is built in to Windows 7 & 8, so only useful if they're using one of these). A guide on how to run it is available here:
http://pcsupport.about.com/od/toolsofthetrade/ht/problem-steps-recorder.htm
They could then send you this file which would mean you could see exactly what they're doing and what the outcome is.
Often what's going wrong is that the customer is omitting some detail that seems insignificant to them (always makes sure to submerge everything in water before use, for example), but is actually the other part of the cause. Ideally, you want as much detail as possible. If practical, visit in person to see the bug in action. If not, see if they can make a video recording of start to finish.

How to make an ipad app impossible to close

I am programming an app for an experiment by the University of Queensland Psych Department. The app needs to be impossible to exit, or at least it would be preferable if it were impossible to exit. This is not a virus- it is for an experiment with the Grute Eylandt Aborigines. Anyways, do any of you guys have any idea how to set the app to be impossible to exit, or even better, to set it so that you have to enter a password to exit it? Furthermore, on a separate subject, do you guys have any idea how I can save the information in the app to the iPhone? This app will not go through the App Store so it does not need to follow App Store rules. Therefore, if there was a way to save "Button (whatever button it is) pushed at (time and date)" to the notes section of the iPhone every time a button was pushed in the app, and/or to save audio recorded using the AudioToolbox framework to the actual iPod library, that would be fantastic. Otherwise I would have to make some sort of db or plist file to save everything with if-then statements, I think. Thank you!
Check-out iOS 6 Accessibility feature:
It allows a parent, teacher, or administrator to limit an iOS device
to one app by disabling the Home button, as well as restrict touch
input on certain areas of the screen
Put the device in a "kiosk" case so keep the home button from being pressed. For storing the data to the device, if it is a small amount of data, use NSUserDefaults, if this will be a large amount of data, I would lean more toward Core Data
Easiest solution on the market -- MOKIMOBILITY has developed software that allows you to lock the home button. It is Mobile Device Management software with a full range of security features. It essentially locks down your iPad so the user is only able to use what you what them to use. It is called +MDM www.mokimobility.com The software can be managed mobile-y from a central interface. Slick software.

Switching flight mode programmatically

Is there any way switch on/off flight mode programmatically in Windows Phone 7.5. What I want to do is create background task which will be check time and switch on/off flight mode.
Thanks in advance.
No, this functionality is not available.
It was a design principle behind the platform that applications should not be able to do things without the user knowing it.
If such functionality was available then it would be possible for an app (either deliberately or accidentally-though a bug) to get the devices state in a setting other than what they user may expect. In such a scenario users will typically blaim the phone/platform for what has happened, not a misbehaving application.
Though you cannot programatically do it (as others have mentioned), you can send the user directly to the proper page in the settings panel and allow them to do it. Here's an example of using the ConnectionsSettingsTask:
http://msdn.microsoft.com/en-us/library/hh394011(v=VS.92).aspx
You would want to set the ConnectionSettingsType property:
http://msdn.microsoft.com/en-us/library/microsoft.phone.tasks.connectionsettingstask.connectionsettingstype(v=VS.92).aspx
To 'AirplaneMode'.

Resources