Giter VIP home page Giter VIP logo

homebridge-flexom's Introduction

Homebridge Flexom plugin

verified-by-homebridge Downloads Version GitHub issues GitHub pull requests GitHub Workflow Status

This Homebridge plugin exposes Flexom smart homes to Apple HomeKit.

Status

Currently, this plugin supports mapping Flexom Zones (i.e. rooms) as Homekit accessories, with light and window covering controls.

This plugin relies on @rsauget/flexom-lib to interact with Flexom APIs.

Install

The recommended way to install this plugin is through Homebridge UI.
You will find it easily by searching @rsauget/homebridge-flexom.
For other installation methods, please refer to the Homebridge documentation.

Setup Development Environment

To develop Homebridge plugins you must have Node.js 14 or later installed, and a modern code editor such as VS Code. This plugin uses TypeScript to make development easier and comes with pre-configured settings for VS Code and ESLint. If you are using VS Code install these extensions:

Install Development Dependencies

Using a terminal, navigate to the project folder and run this command to install the development dependencies:

npm install

Build Plugin

TypeScript needs to be compiled into JavaScript before it can run. The following command will compile the contents of your src directory and put the resulting code into the dist folder.

npm run build

Link To Homebridge

Run this command so your global install of Homebridge can discover the plugin in your development environment:

npm link

You can now start Homebridge, use the -D flag so you can see debug log messages in your plugin:

homebridge -D

Watch For Changes and Build Automatically

If you want to have your code compile automatically as you make changes, and restart Homebridge automatically between changes you can run:

npm run watch

This will launch an instance of Homebridge in debug mode which will restart every time you make a change to the source code. It will load the config stored in the default location under ~/.homebridge. You may need to stop other running instances of Homebridge while using this command to prevent conflicts. You can adjust the Homebridge startup command in the nodemon.json file.

homebridge-flexom's People

Contributors

dependabot[bot] avatar renovate-bot avatar renovate[bot] avatar rsauget avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

grimaldev

homebridge-flexom's Issues

Triggering some blinds manually (ie. not from Flexom/HomeKit) result in a forever loading state in the Home app

Hello,

First of all, thanks a ton for this integration to Homebridge! Never liked the official Flexom app to be honest, I'm really happy to have finally found an alternative to it :)

Describe The Bug:

Just having a slight issue with the blinds, where in some not-so-rare cases a blind would stay in loading state in the Home app, that until I reboot my Homebridge server, which would I assume re-poll the blinds states from the Flexom API and thus update HomeKit accessories. Note that this does not seem to not happen to the lights.

To Reproduce:

To reproduce, it looks like to me that the blind would need to be partially closed (eg. 97%), and the action would need to be taken using the physical wall-mounted control, ie. not Flexom nor this integration. In my case, the blinds are a kind of BSO (sun-blocking, can be fully closed yet each flap has an aperture of ~45 deg letting the light pass in, but blocking the sun rays producing heat), so those are not traditional blinds we typically see in most homes.

In case I need to have them in that fully closed state, yet sun-blocking and light-passing, I'd fully close them with the physical control button, and then make them go upwards again and then block them with a control button (all that from the physical button, ie. not from the Flexom app or this integration). In certain cases, Flexom's "buggy" systems understand that the blinds are like 97%-98% closed, while they are in reality 100% closed.

I assume that this non-100% factor is what could make your Homebridge integration to believe that the "closing" or "opening" action is still ongoing, forever, thus resulting in a forever-loading spinner in the Home app.

Image of a similar blinds: https://www.bimobject.com/en/content/showproductimage/aaa5ad73-b452-4ee6-8458-ef03ce4e4f60/371623/default?ver=20200803072245

Expected behavior:

I would expect the loading state to disappear once the blinds are not moving anymore.

Fix pathway:

I have no knowledge of how this Homebridge integration works, but I would assume that it's expecting the window covering accessory value polled from Flexom API to reach some target number in order to consider the action as fulfilled. In such cases, I'd add a ~10% margin for error tolerance in order to consider the action as complete, which would effectively fix the aforementioned issue for BSO-type blinds.

Logs:

Manually 100% closed (full light-blocking BSO) then re-opened the blinds ~15 minutes later to their closed yet light-passing BSO state (so, closed to 100% position but aperture at 45deg).

[27/07/2021, 18:42:13] [Flexom:Office:WindowCovering] changed from 0 to 50
[27/07/2021, 18:59:16] [Flexom:Office:WindowCovering] changed from 50 to 7.000000000000001

After this 18:59 time on 27th, the forever loading state started appearing in the Home app, and is still there right now.

Plugin Config:

        {
            "name": "Flexom",
            "email": "xxxx
            "password": "xxxxx",
            "zones": true,
            "excludeZones": false,
            "excludedZones": [
                {
                    "light": true,
                    "window": true
                }
            ],
            "things": false,
            "platform": "Flexom"
        }

Screenshots:

Environment:

  • Plugin Version: v2.2.4
  • Homebridge Version: v1.3.4
  • Node.js Version: v14.17.1
  • NPM Version: v7.17.0
  • Operating System: Raspbian GNU/Linux Buster (10)

WebSocket disconnects after some time, and requires Homebridge restart to reconnect

Hello there!

Overall Homebridge-Flexom is working great :) I've noticed a tiny issue w/ the WebSocket input channel, allowing to update HAP state whenever eg. a physical light switch is powered on or off, in real-time. This works just fine when Homebridge was just restarted, although after some time (days? network loss? anything else) it loses connection to the WS server and never reconnects.

When this happens, controls from HAP still work eg. I can hit Hemis API and enable/disable lights or control roller shutters, but physical actions are not reflected in real-time anymore in HAP. Restarting Homebridge will force the Homebridge-Flexom plugin to restart, which will reconnect to WebSocket, and fix the issue, until this happens again.

Flexom V3 ?

Hello,

First of all, thank you for your research and development about this subject.

I'd like to know which platform this plugin is compatible with, as Flexom V3 is now the new used app which isn't compatible with Flexom V2. It looks like you have developed this plugin using Flexom V2, do you know if it would work with Flexom V3 ?

Flexom V3 is connected to the Hattara® Rail DIN bridge from Overkiz and as far as I know it uses EnOcean as a main protocol but you can expand it with additional modules (e.g. Zigbee module etc...).

It isn't really clear to me how all this works yet, so maybe I misunderstood something.

Thanks in advance for your answer ! 😊
Best regards,
Lucien

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/build.yml
  • actions/checkout v4
  • actions/setup-node v4
.github/workflows/codeql-analysis.yml
  • actions/checkout v4
  • github/codeql-action v3
  • github/codeql-action v3
  • github/codeql-action v3
npm
package.json
  • @rsauget/flexom-lib ^3.3.0
  • lodash ^4.17.21
  • @types/lodash 4.17.6
  • @types/mocha 10.0.7
  • @types/node 20.14.10
  • @typescript-eslint/eslint-plugin 5.62.0
  • @typescript-eslint/parser 5.62.0
  • chai 5.1.1
  • eslint 8.57.0
  • eslint-config-airbnb-base 15.0.0
  • eslint-config-airbnb-typescript 17.1.0
  • eslint-config-prettier 9.1.0
  • eslint-plugin-import 2.29.1
  • eslint-plugin-prettier 4.2.1
  • homebridge 1.8.3
  • homebridge-config-ui-x 4.56.4
  • mocha 10.6.0
  • nodemon 3.1.4
  • prettier 2.8.8
  • release-it 17.4.1
  • rimraf 3.0.2
  • ts-node 10.9.2
  • typescript 4.9.5
  • node >=14

  • Check this box to trigger a request for Renovate to run again on this repository

Les accessoires Flexom n'apparaissent pas

Describe The Bug:
après installation, je ne vois aucun des accessoires présent dans Flexom

Logs:

TypeError: form_urlencoded_1.default is not a function
at axios_1.default.create.transformRequest (/Users/T/.npm/_npx/14098/lib/node_modules/@rsauget/flexom-lib/dist/hemis/hemis.js:78:49)
at transform (/Users/T/.npm/_npx/14098/lib/node_modules/@rsauget/flexom-lib/node_modules/axios/lib/core/transformData.js:16:12)
at Object.forEach (/Users/T/.npm/_npx/14098/lib/node_modules/@rsauget/flexom-lib/node_modules/axios/lib/utils.js:247:10)
at transformData (/Users/T/.npm/_npx/14098/lib/node_modules/@rsauget/flexom-lib/node_modules/axios/lib/core/transformData.js:15:9)
at dispatchRequest (/Users/T/.npm/_npx/14098/lib/node_modules/@rsauget/flexom-lib/node_modules/axios/lib/core/dispatchRequest.js:30:17)
at processTicksAndRejections (internal/process/task_queues.js:93:5)

Plugin Config:

{
"name": "Flexom",
"email": "",
"password": "",
"zones": true,
"excludeZones": false,
"excludedZones": [
{
"light": true,
"window": true
}
],
"things": true,
"platform": "Flexom"
}
],
"accessories": []
}

Screenshots:

Environment:

  • Plugin Version: v2.2.1
  • Homebridge Version: v1.3.4
  • Node.js Version: v14.16.1
  • NPM Version: v6.14.12
  • Operating System: macOS

Update flexom-lib w/ updated ws delay fix + homebridge-flexom w/ latest flexom-lib

Hello there!

Would it be possible to release all changes from flexom-lib master and update homebridge-flexom with the new version of the library?

I'm using homebridge-flexom on a daily basis at my home (thanks a ton, it does work great!), and I think that having the WS channel send less frequent keep-alives and pings would be nice.

BTW quick side-question: when building flexom-lib, did you see any way the smoke detector data could be fetched from Flexom API? I have a connected smoke detector at home, which is available through the Flexom app. Could be super useful to have it appear in HomeKit, w/ smoke alerts coming in as well! — Opened issue #68 for this one.

Thanks again for your work!

Valerian.

Exclude some accessories

Hi,

First of all, thank you very much for this plugin which is very helpful and complete ! I was looking for that for a very long time and thank you so much !

I would like to know if there is a way to exclude some accessories. Because currently, if I put my ID and password, it brings with all accessories (bulbs and rolling shutters) and with empty zones. I would like to import, for example in my case, only rolling shutters (neither empty rooms nor bulbs). Do you know how could I do that and if I could ?

Environment:

  • Plugin Version: v1.0.7
  • Homebridge Version: v1.1.6
  • Node.js Version: v12.19.0
  • NPM Version: v6.14.8
  • Operating System: Raspbian (Raspberry-pi)

Impossible de contrôler les IoT

Je viens de setup Homebridge.
Mon appartement est équipé avec flexom, j'ai installer le plugin et sur la Home app j'ai a liste de mes rooms mais je ne peux rien faire dessus. les 3 screenshots montre mon app flexom avec la liste des rooms et des things
IMG_010C7F7226D6-1_result
4D3B7152-B7ED-4778-81BA-5989BA00437E_result
019ED18E-445E-4A86-8AF9-601E811257E4_result

Celui-la montre dans Home App la liste des rooms mais me marque qu'elles sont incompatibles.
B83FE6FB-17CA-43A9-9000-EAF7F172064C_result

Dans Homebridge il n'y a rien qui apparait
Screenshot 2021-04-03 at 19 59 30

Homekit interference with manual switches

Describe The Bug:
I have Flexhom ready house with all my light switches that are directly wirelessly connected to an IOT gateway.
After some time deploying my homebridge (1 or 2 days), If I manually use the light switches, I will have to send an "Off" request (homekit manualy or siri) to recalibrate and send an "On" request to finally turn on the light.

I tried every configuration I could know of and tried re-installing my homebridge multiple times.

Plugin Config:

{
    "name": "Flexom",
    "email": "XXX",
    "password": "XXX",
    "zones": true,
    "tolerance": 0.05,
    "excludeZones": false,
    "excludedZones": [
        {
            "light": true,
            "window": true
        }
    ],
    "things": false,
    "platform": "Flexom"
}

Environment:

  • Plugin Version: v3.1.0
  • Homebridge Version: v1.6.0
  • Operating System: Raspbian GNU/Linux 11

Smoke sensor accessory

When building flexom-lib, did you see any way the smoke detector data could be fetched from Flexom API?

I have a connected smoke detector at home, which is available through the Flexom app. Could be super useful to have it appear in HomeKit, w/ smoke alerts coming in as well!

Given the metrics available on the screenshot below, it could also be used to create HomeKit accessories reporting air temperature, humidity, AQI and even smoke sensor fault (eg. reported as non-working).

I am eager to provide Charles Proxy traces to help on that.

Here are some screenshots of the object that appear in the Flexom app on my side:

IMG_6024
IMG_6025

Ability to configure accessory state poll interval in seconds (lights + blinds)

The default poll interval of 60s results in frequent rate-limiting from Flexom's APIs (429), which persists and requires an Homebridge plugin stop then wait, then restart.

I've checked at this module's source code and found out that 1 equipment polled = 1 HTTP request out. I assume large homes with a lot of rooms and IoT devices will result in frequent 429s. I've adjusted the poll interval to 600s in the code, which fixed my rate limiting issues.

A solution to this could be to let the user configure the poll interval, just as https://www.npmjs.com/package/homebridge-dyson-pure-cool does (the homebridge-nest-cam plugin also does that). That way, the more IoT equipments one has, the more the poll interval can be increased. Which alleviates all rate-limiting issues.

I'd be happy submitting a PR if you're interested.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.