50ButtonsEach / hax-with-flic-osx

Basic Flic application for Mac.
105 stars 13 forks source link

Support for multiple flics? #2

Open danmac opened 8 years ago

danmac commented 8 years ago

I can't tell if this is possible currently, but I have 4 flics I would like to connect to my Mac, and can't tell if there is a way to do this currently. The menu doesn't seem to let me add another one once I connected the first one.

AntonMeier commented 8 years ago

The current version unfortunately only supports one Flic. Adding support for multiple buttons is of course of high priority for future versions. We will asses, depending on the response we get on this project, how and when we will continue the development work.

erikvg01 commented 8 years ago

I second this. I'm really itching to use the Flic's as the primary human interface to the home automation system in my house...Right now the iPad app is brokering connections to the mac mini server which is executing all the scripts, but that burns up the iPad as being an iPad...It needs to be effectively stationary and always plugged in.

AntonMeier commented 8 years ago

It will be available hopefully sooner rather than later.

wejstal commented 8 years ago

Any ETA on this? Really limiting with just one flic, however it works every time :) much better than using an iPhone.

dermotos commented 8 years ago

Just like to add my +1 regarding Flic on Mac. I'd like to interface with a node.js server. Once some kind of SDK becomes available, i'll be placing my order for ~20 of these!

Edit: Also, it's worth noting that there is a severe lack of physical controls on the market for home automation systems. I use voice and apps for controlling lots of things like blinds and the like, but in many circumstances (e.g.: turning on a bathroom light at 3am) there's no replacement for a physical button. Currently, there is no commercial option for this, I'm using custom made arduino button units. A tidy, wireless, programmable button like Flic is the dream, but connecting via a phone feels too hacky for me right now.

AntonMeier commented 8 years ago

Thanks! We are currently working on something that I believe will be great and should cover all the things you want to do. It is going to be a mix between a full Flic app (for ordinary users) and a hack-app for those who want to make cool things on their own.

On top of that we are also building in support for the mac app to act as a "Flic Deamon" to support the TCP Client/server protocol that we have put together for our Linux SDK, which means that people can hook up the button events to pretty much anything they want. We already have a node.js client lib available for that so I guess that would be something for you to look at in the future.

We will get back to you guys as soon as possible with an ETA. I also think it would be cool to involve more people during the development as well so that we can get feedback early on.

wejstal commented 8 years ago

Sounds good! I will gladly help and give you feedback!

AntonMeier commented 8 years ago

Today I have added a new repository, flic-service-osx, that contains an application that includes a TCP server for Flic communication. This is compatible with the client libs that we have made available previously, such as NodeJS and Java. With this you are free to scan and connect as manny buttons as you like and tie them up to your own applications, either on the local computer, or on your local network.

However, if you try this out you must unfortunately uninstall hax-with-flic first since undefined stuff can happen if you try and use both of them. The idea is that once the Flic app for mac is done in the future then this service will be built into that, meaning that your applications will work with that as well out of the box. Let me know what you think!

wejstal commented 8 years ago

Thanks @AntonMeier unfortunately my skills are limited, installation is pretty straight forward, but I'm not sure how I could add a flic by using the linux-hci. Do I need to compile anything for this? An example would be great :)

AntonMeier commented 8 years ago

Well actually I guess this is aimed for developers. The only thing the flic-service-osx will do is to set up a TCP server on your computer that will distribute button click events to different clients on your computer or network. This means that you would actually have to do the client application on your own. The examples that i referred to on the fliclib-linux-hci repository are just sample clients that can be used for reference, but they don't actually do anything other then print the events.

I don't know how much development experience you have with these kinds of things, but it should not be too hard to get going if you just have some free time :) Otherwise I suggest you wait until someone else publishes their own clients.

wejstal commented 8 years ago

I should probably aim for some free time then :)

wejstal commented 8 years ago

Any news?

AntonMeier commented 8 years ago

We are getting there.. slowly but surely..

screenshot2016-07-06

wejstal commented 8 years ago

Looks really good! Let me know if you need beta-testers!

asabi commented 8 years ago

Wow, can't wait for this. +100 from me. I have been using it since day one with a button to control my TV and sound bar with no issues. I press the button, and it works !

Actually works better than my 100$ Logitech remote !

wejstal commented 8 years ago

Any news about the client?

AntonMeier commented 8 years ago

The news at this time is that it is about 90% done. We have unfortunately had to put it a little bit on hold right now as we are working on the release of a different project with higher priority. Stay patient. I will do my best to make time and push for a beta release of the Mac app as it is definitely something that I value a lot personally.

samph commented 8 years ago

If this has been depriortied how about putting up the WIP to a branch/fork for others to contribute to?

wejstal commented 8 years ago

Been quiet for a while now! Would it be better for us to look into the Linux version? Or can we expect an update here anytime soon?

AntonMeier commented 8 years ago

Yes I know :( I can honestly say that we are not working on that particular Mac application at this time. I can also not say when we will have time to start working on it again. It might be soon, but it also might not be, it really depends on how the scheduling of other projects turns out for us.

In the meantime, yes, it would be awesome if someone wanted to look at the flic daemon protocol that is available for Mac/Linux/PC. That protocol is fully uniform between the platforms so my dream is if someone decided to start an open source cross platform app that is compatible with that protocol.

Another thought that I had was if I just bite the sour apple and spend an evening or something to just add multi-button support to the current app. This is basically what people wanted in the beginning, but we sort of opted out of it in favor of the other application.. But it just feels unnecessary to spend time on something that we eventually will move away from. I'll see what I can do.

tdupre commented 8 years ago

That's shame your UI looked closed to completion :( I only bought the Flic to use with the computer thinking the Mac app would be released soon enough.

axelnormand commented 8 years ago

Also a shame. I was looking forward to hooking up multiple flics to my mac. The screenshot looked awesome to me!

wejstal commented 8 years ago

@AntonMeier Yes if it's possible to just spend a couple of hours to finish the current app it would be very much appreciated. :) I will be very expensive for me if I need one dedicated Mac for every button! hehe! As always, let me know if you need any help with beta-testing

AntonMeier commented 8 years ago

Ok, fair enough, I guess I can do that within reasonable time at least!

asabi commented 8 years ago

BTW, the screenshot looks amazing, but the reality is that the current functionality with the one button is good enough, we just need the multiple buttons (all the "sonos, slack, Lifx, hue" etc can be achieved through the shell script we can run (for example by triggering an IFTTT maker channel) ... I guess what I am saying is that there is no need for the fancy interface, just allow it to connect to multiple buttons, and provide the same "run this on click" interface.

That's my two cents ...

AntonMeier commented 8 years ago

Okey, so I took some time this evening to hack together a hax-with-flic version with support for multiple buttons. Before I push it to the repository it would be great if anyone could at least try it out and see how it works. I have not really had much time to properly test it so there are probably some bugs. I have noticed a few UI-glitches that I will fix later. I also have some patches to the bluetooth code that I will add before I'm done. To install this, simply make sure that you close the old program (if it is currently running) and then replace the app file in your applications directory.

Anyhow, here is a link: (--Link removed--) Let me know if you find anything bad. Please also confirm if it is working for you. @wejstal @asabi @axelnormand and the rest of you..

asabi commented 8 years ago

k, thank you. Just tried it with two of my buttons. Seems to work well.

Two potential issues:

  1. I noticed that if the button I am about to connect is not setup to pair, the app goes into an infinite loop with an "ok" window that says that there are no buttons, until it quits. Once I disconnected the button from my previous device, and it was ready to pair, it was fine. I was able to run different scripts depending on which button I press.
  2. I am using it on a laptop. When I put my laptop to sleep, and turned it back from sleep, the app quit on me a couple of times, not consistently though. I will keep you posted.
AntonMeier commented 8 years ago

Cool, thanks! That is exactly the kind of feedback I was hoping for! I will take a look at the issues that you brought up.

tdupre commented 8 years ago

I just tried with four buttons :

tdupre commented 8 years ago

And now the app won't start again, tried deleting it, tried removing db in Application Support. Nothing starts, it's strange.

Also, for the time I had 3 buttons, deleting a button didn't seem to trigger anything (it worked on the previous version of the app with one button).

AntonMeier commented 8 years ago

Auch.. that sounds bad.. may I ask what computer model you are using?

tdupre commented 8 years ago

Sure capture d ecran 2016-10-04 a 14 40 44

asabi commented 8 years ago

Hi tdupre,

Have you tried manually removing the buttons from your Bluetooth ? It may help it start the app.

tdupre commented 8 years ago

I removed 3 buttons manually from Bluetooth, tried starting again, then I deleted app from 'Applications', cleaned application support, copy-pasted application in 'Applications'. I still don't get any boot. The app boots, I can see it on the status bar : image Then it crashes (the blank spot disappears).

tdupre commented 8 years ago

Here's the crash report: HaxWithFlic_2016-10-04-164441_MacBook-Pro-de-Thibaut.txt Ping me if you need more info (also if you have a way to reset everything)

AntonMeier commented 8 years ago

Thanks for the crash log! It appears as if the bluetooth manager has got stuck it a bad state and return a nil object for a button that should be removed. I built another one now that does not necessarily fix the problem, but it should at least not crash. This way we should be able to at least be able to troubleshoot further..

Try this one (-Removed-) and if it ends up showing buttons without a name then delete them and try again. Sorry for the issues! Normally I try and test my stuff better, but I sort of ran out of time last night :P

wejstal commented 8 years ago

Great work! I'm only trying with 2 flic right now, but it seems to work great. The only issue I have right now is that it's hard to distinguish between the different flics, so any way to give them names would be great :)

AntonMeier commented 8 years ago

Yep I know that it can be tricky to distinguish between them. If I have time I will try and just add a field where you can actually set the name manually yourself.

tdupre commented 8 years ago

Will update tomorrow morning with results/feedback

tdupre commented 8 years ago

Follow up: app starts again, here's what I get: capture d ecran 2016-10-05 a 09 29 29

When I try to delete a button, I get a crash, here's the crash report HaxWithFlic_2016-10-05-092944_MacBook-Pro-de-Thibaut.txt

Adding a button works fine (but I can't delete the others) capture d ecran 2016-10-05 a 09 33 45

When I add a second button, here's what I get: capture d ecran 2016-10-05 a 09 35 22

When I add a third button, here's what I get: capture d ecran 2016-10-05 a 09 36 23 for a moment then: capture d ecran 2016-10-05 a 09 37 06

Fourth button goes like this: capture d ecran 2016-10-05 a 09 38 37

BUT all 4 buttons are active and paired (I get the ding when I press them)

The button that is showed as null, is the same one that would crash my app yesterday.

AntonMeier commented 8 years ago

Okey. Thanks! I'll dive into this issue when I get home tonight :P Extremely weird, but I sort of think I know what it might be. Very sorry about it.

asabi commented 8 years ago

I will speak on behalf of Thibaut, but we are grateful for your time, we all understand it is part of development. Keep on the good work, there is progress and that's what's important.

tdupre commented 8 years ago

Hell yeah, VERY grateful! Besides, it works now so it's awesome :)

wejstal commented 8 years ago

This might have been said before, but it looks like the software is crashing every time I add a button, but after restart of the application it works fine. Been testing it a couple of days now!

AntonMeier commented 8 years ago

I know. I looked at it and I did a little mistake there :( Most probably the new version will be out tomorrow. That is unless I find something else that is wrong.

wejstal commented 8 years ago

I'm actually experiencing app crashes now, it usually happens if the script isn't working, like if it's calling for a URL and that isn't reachable. Maybe this is fixed in the above "fix".

AntonMeier commented 8 years ago

Please test this version HaxWithFlic-0.2.3

I have not yet adressed anything regarding crashes that occur when scripts are not working like you mentioned.

AntonMeier commented 8 years ago

Like always, you should only have to close the previous installation and replace the app file. Not delete anything in /Application Support.

wejstal commented 8 years ago

So far so good! :) Any news on the big project that you prioritize over building the MAC client? ;) Stand alone receiver?

wejstal commented 8 years ago

So I have been troubleshooting my iMac for the couple of days now, the problem is that even though it's in sleep mode it suddenly wakes up for no reason, this happens somewhat randomly. I have tried turning of both wake on LAN and the ability for bluetooth devices to "wake the computer", nothing helped, so as a last resort I quit the flic application and all my problems went away. Of course I can not use the buttons now.

I did not see this behavior with the old single button app but somewhere just before or maybe after that I upgraded to MacOS Sierra the problems arose.

Please note, the iMac is my "develop" environment for the daily usage of the flic app I use a always on Mac mini and it does not have a screen so I'm not able to tell if this behaves the same way.