Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create high-level, REST-like API on top of this hopeless abomination #24

Open
bartekpacia opened this issue Jul 25, 2024 · 6 comments
Open

Comments

@bartekpacia
Copy link
Owner

this API is pain to use and pain to live with.

@bartekpacia bartekpacia changed the title Create high-level, REST-like API on top Create high-level, REST-like API on top of this hopeless abomination Jul 25, 2024
bartekpacia added a commit that referenced this issue Sep 17, 2024
@pugson
Copy link

pugson commented Dec 12, 2024

i truly admire your dedication to work with this piece of garbage. this joke of a company should go out of business...

have you looked into integrating it with home assistant?

my plan was to use puppeteer to literally click buttons on the awful f&home dashboard and scrape it to translate that into a REST API for piping into home assistant.

or alternatively ripping out all this hardware out of my walls and replacing it with something open.

@bartekpacia
Copy link
Owner Author

finally – someone who gets my pain. welcome to hell!!!

my plan was to use puppeteer to literally click buttons on the awful f&home dashboard and scrape it to translate that into a REST API for piping into home assistant.

Haha, this would probably work. A problem would be that when you add/remove/modify an object in F&Home mobile app (or the windows-only configurator app, which I bothered to learn to use), you'd have to scrape the dashboard again to see updates reflected.

I think we could make a use of my work and tears I already spent here.

There's a simple CLI program fhome in this repo that can already list objects in your home, and then perform operations.

If you're on macOS you can install it with brew install bartekpacia/homebrew-tools/fhome.

Some examples of what it can do:

list objects Screenshot 2024-12-12 at 23 44 43

also take a look at fhome config list --user and fhome config list --system, each do a bit different thing.

Oh, and there's also --json flag. Now I see it's doesn't work well but it's some starting point:

Screenshot 2024-12-12 at 23 48 15
interact with objects Screenshot 2024-12-12 at 23 46 44

Now I'd have to expose this functionality not as a CLI app, but as a HTTP server, and I guess from there you can do anything with it.

have you looked into integrating it with home assistant?

Unfortunately, no.

I've always had the idea of looking into HomeAssistant and writing F&Home plugin for it, though. But frankly, what I have right now is kind of enough for me and my family (coupled with a one-off piece of crap called telegram-fhome-bot).

Also if you have any more questions, or ideas, feel free to create more issues/comments.

@bartekpacia
Copy link
Owner Author

bartekpacia commented Dec 12, 2024

I did integrate it with Apple's HomeKit though, but it's pain in the ass (not only because of F&F, but also because of Apple, and probably some more reasons I forgot), so I don't use it anymore. But it works (t even syncs objects' state both ways, between F&Home and Apple). It's implemented in cmd/fhomed directory).

I also had ideas of building a better mobile app, or a better web panel1, but yeah it's much better idea to think how to make it work with HomeAssistant. I never used HomeAssistant though nor wrote any plugin for it, so yeah, there's that.

Footnotes

  1. I remembered that cmd/fhomed hosts a simple index.html that displays objects in your system: https://github.com/bartekpacia/fhome/blob/4cd69b53e1b764855ec22372e2703edc02c5decf/cmd/fhomed/hack.go#L48-L71 . Could be some starting point if you wanna explore.

@pugson
Copy link

pugson commented Dec 12, 2024

it's good to know that i was not the only one having a mental breakdown trying to crack their garbage angular/websocket setup for running this poor excuse of an app.

A problem would be that when you add/remove/modify an object in F&Home mobile app (or the windows-only configurator app, which I bothered to learn to use), you'd have to scrape the dashboard again to see updates reflected.

i was planning on never touching anything in there again 😂

the install was done by some "smart home expert" hired by the home developer. they were promising Fibaro but of course a last minute cost-cutting bait & switch resulted in the unimaginable horror of F&Home.

the only two elements that i care about are opening/closing of garage doors and setting the floor heating temp. i can rip out all the other modules from the walls and replace them with something that runs on zigbee and integrate it straight into Home Assistant.

There's a simple CLI program fhome in this repo that can already list objects in your home, and then perform operations.

oh that's nice. i'm running a mac mini server so this could be abstracted into commands sent from Home Assistant. less overhead than running a puppeteer instance!


thanks for your quick response and hard work! i've sent you a small token of appreciation over gh sponsors 🙏

@bartekpacia
Copy link
Owner Author

bartekpacia commented Dec 13, 2024

thank you so much, I really appreciate it!

if you need any help with running the fhome CLI please just ask {here/in some other issue} (let's keep the conversation public in case some other poor soul with F&Home stumbles here). I think you'll figure it out but if not/don't have time I can whip up some readme:)

the install was done by some "smart home expert" hired by the home developer. they were promising Fibaro but of course a last minute cost-cutting bait & switch resulted in the unimaginable horror of F&Home.

Oh, this sucks, I'm sorry!

In my case, the whole system was chosen for my family's house before I could even code. If my dad was building the house now, I'd do my best to talk him out of F&Home, but back then, I couldn't care less. Now it's like cancer on the healthy tissue of the house – it's in every wall, every light, every fucking switch, and ripping it out has been my dream for years now, but unfortunately it'll probably never happen.

btw, I'm curious you're saying you are willing to get rid of F&Home electronics in your place – maybe it's easier than I assumed it is? I'm not big on electronics. If you end up doing something in this area I'd love to hear more.

the only two elements that i care about are opening/closing of garage doors and setting the floor heating temp.

If you really only care about these two things, then it should be quite easy to use this project to hardcode object IDs of your garage door and floor temp, and then expose this as:

  • some HTTP API (for a few months I was opening my entrance gate with Apple Shortcuts app by making a HTTP request. code here)
  • home assistant plugin?
  • Telegram bot

@pugson
Copy link

pugson commented Dec 13, 2024

Now it's like cancer on the healthy tissue of the house – it's in every wall, every light, every fucking switch, and ripping it out has been my dream for years now, but unfortunately it'll probably never happen.

absolutely awful. i fully understand your frustration and i'm not even living in my house yet!

you're saying you are willing to get rid of F&Home electronics in your place – maybe it's easier than I assumed it is?

i've done some brief research inside the F&Home Configurator app and compiled a list of all the installed F&F modules. seems like they can be replaced with other relays that use the same parameters? there are lots of modules that use this wiring standard.

F&F uses their proprietary radio while Shelly runs on WiFi and can be used with any system but these modules are pretty much equivalents. at least that's what ChatGPT told me...

i recommend pasting in links to whatever hardware from F&F you have and asking it to offer alternatives that work with HomeKit or whatever system you want to integrate with.

this is all very new territory for me. any serious electrical engineer stumbling upon this thread will probably have a good laugh but you gotta start somewhere 😅

@bartekpacia bartekpacia pinned this issue Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants