Giter VIP home page Giter VIP logo

homebridge-blinds's People

Contributors

alexstaravoitau avatar dxdc avatar robintemme avatar slavikme avatar strykaizer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

homebridge-blinds's Issues

Error message

Every time I try to move my blinds I get the message http status code 404. I’m using the bond config however it’s not working for me at all

getcurrent position for insteon open/close blinds accessorie

Hello,
first of all I think this is the best plugin for blinds in homebridge.
Is simple, reliable and it works fine also in homekit app with iOS 12.
I was thinking about the "problem" of current status for insteon accessories.
And I wrote this piece of code to retrieve current status for insteon device.
In insteon devices status of a blinds is saved in a buffstatus.xml after the device is called with a request code 0x19.
example:
http://xxxxx:xxxxx@ip_address:25105/3?02623296C20F1900=I=3
in buff status you will find in BS tag element a string where in a position you will have FF is the blinds is open and 00 if the blinds is closed.
If someone has the time to take a look and give me some hints how to integrate in homebridge-blinds will be awesome, anywise thank you for the great job.
Standalone code is working fine, but I have some problem to integrate in this code.

var XMLHttpRequest = require('node-http-xhr');
var btoa = require('btoa');
var xhttp = new XMLHttpRequest();

xhttp.onreadystatechange = function() {
    if (this.readyState == 3 && this.status == 200) {
        myFunction(this);
    }
};
xhttp.open("GET", "http://ip_address:25105/buffstatus.xml", true);
xhttp.setRequestHeader("Authorization", "Basic " + btoa("xxx:xxxxxx"));
xhttp.withCredentials = true;
xhttp.send();

function myFunction(xml) {
    var xmlDoc = xml.responseText;
    console.log("risultato:" + xmlDoc.substring(52,54));
    if (xmlDoc.substring(52,54)== 'FF')
    {
        this.lastPosition= 1;
      
    }
}

Config param for initial default state

To Me it would be the much better if the default state would be that blinds are up.
Since my blinds are up most of the time.
With a config parameter it can be customized for everyones taste.

Empty body in request on POST

Hey,

Seems that body content in POST is not working properly; seems that body even though is filled seems empty:
This is my config:

{
"name": "Blind",
"up_url": {
"url": "http://192.168.1.5/msg.htm",
"method": "POST",
"body": "send_ch=4&send_act=160"
},
"down_url": {
"url": "http://192.168.1.5/msg.htm",
"method": "POST",
"body": "send_ch=4&send_act=192"
},
"stop_url": {
"url": "http://192.168.1.5/msg.htm",
"method": "POST",
"body": "send_ch=4&send_act=144"
},
"verbose": true,
"accessory": "BlindsHTTP"
}

And triggering actions returns UNKNOWN_STATE on blinds, which means body was empty.

Simple curl:

curl -X POST -d "send_ch=4&send_act=160" http://192.168.1.5/msg.htm

Is working like charm.

Any ideas why body is empty?

Cheers!
PS

Config parameter for current blinds position

It would be awesome if you can add a configuration parameter for the current state of the blind. Currently the plugin is blind to any changes.

The config would look like this:

{
    "accessory": "BlindsHTTP",
    "name": "Window",
    "up_url": "http://1.2.3.4/window/up",
    "down_url": "http://1.2.3.4/window/down",
    "stop_url": "http://1.2.3.4/window/stop",
    "state_url": "http://1.2.3.4/window/state",
    "motion_time": "<time your blind needs to move from up to down (in milliseconds)>",
    "http_method": "PUT",
    "trigger_stop_at_boundaries": false
}

Get blind state via webhook

Hello!
In order to be able to control some internal device depending on blind state (up or down), I would like to be able to know via the webhook the state of a given blind. This is to stop some internal network device by asking via webhook in case the blind is down.

I am asking this because my Somfy blinds to not have position_url system so I am not able to use the URL "http://192.168.1.40:51828/?pos=00" to do what I want.

Or is there a simple way with ?pos even if I have no position_url? Or would this require some dev for you to export simple up/down statesvia webhook?

Many thanks in advance!

Error getting state

Hello zwerch
Thank you very much.
I useing your Homebridge_blinds in my system, it work great.
My blins only have UP and DOWN funtion so i put it in config.json file like this
{
"accessory": "BlindsHTTP",
"name": "blinds",
"up_url": "http://192.168.0.99/led/ca1?UP",
"down_url": "http://192.168.0.99/led/ca0?DOWN",
"http_method": "PUT"
}

But i get error message like this
this.log("Error getting state (status code %s): %s", response.statusCode, err);
^

TypeError: Cannot read property 'statusCode' of undefined
at BlindsHTTPAccessory. (/usr/lib/node_modules/homebridge-blinds/index.js:94:68)
at self.callback (/usr/lib/node_modules/homebridge-blinds/node_modules/request/request.js:188:22)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at Request.onRequestError (/usr/lib/node_modules/homebridge-blinds/node_modules/request/request.js:884:8)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:188:7)
at Socket.socketErrorListener (_http_client.js:309:9)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
How can i avoid this issues happen again?

Thank you very much.

Calvin J

Sending exact position in request body

Hello.

My blinds are controlled with deCONZ and they have a robust REST API. I was able to integrate my blinds into homebridge using the homebridge-hue plugin. However, since my blinds are seen as lights by deCONZ, homebridge-hue, homebridge, and finally homekit... it feels a bit awkward to control them with homekit. So I was trying to test out homebridge-blinds to control the REST API directly.

The blinds support moving to an exact position via the REST API. However, the position is set in the request body, not a query parameter as supported in homebridge-blinds.

I was thinking about how to modify the plugin to support setting the position in the body. I could probably come up with a PR to help.

Here are my ideas for the moment:

  • Using jsonata would probably give the most flexibility, since very API may format the body differently
  • My API does not have specific up and down URLs, instead it just as a set position URL. Is it this due to the way homekit works??? Or is it worth trying to refactor a way to support set position only? Here I mean that in my case, there is really no use in tracking the current position because it can be queried from the API at any time. The current position would only be interesting for displaying the state of the blinds in homekit. No need to determine if the command should be up or down. However, I suppose I could just use the same URL for both up and down, and let the plugin continue to calculate the position and determine the command.

Any thoughts before I try to put something together???

Is possible ignore last position?

Hello
Thank for your plugin, but i have problem.
I use two way (switch on the wall) for control my blinds. When blind is up and i use switch blind is go down, but homebridge dont know in whitch position is blind. Then i send blind to up via siri, homebridge answer: already on position. but blind is down via switch on the wall
Please i need this future: when i say siri: “go down” plugin first set it up position to up and after send blind to down. It is posible??
Thank for your answer

Not an issue - just a comment

Amazing piece of code here! I can now set the position of my Somfy blinds (they only respond to Up, Down, Stop) after years of trying to find a way to do it. Great job on this - this might seem like a tiny little plugin but its a game changer. Thank you!

Socket hangup errors when using simultaneously open/close requests

Hi, I tried to manage 6 shutters by using a homekit automation to open/close the shutters simultaneously. But it seems that the underlying nodejs layer is not able to handle this number of requests simultaneously ("Error: This callback function has already been called by someone else; it can only be called one time.")

At least this scenario ends in the termination and restart of the homebridge service ("Got SIGTERM, shutting down Homebridge...").

If I reduce the number of shutters to 3 the homekit automation or manually interaction is working as expected. So it seems there is a kind of race condition or ressource limitation using the plugin.

I'm experimenting with an additional homebridge plugin (homebridge-delay-switch) to model a delayed activation cascade for the shutters, seems to work but leads to cluttered automation rules.

So my question is how to avoid or fix this error. I'm not familiar with nodejs so having a first look to the corresponding source lines from the trace back does not lead to a possible solution.

Thanks in advance for any feedback.

Kind regards, hjk

Dez 27 18:00:00 raspberrypi homebridge[25589]: [27.12.2019, 18:00:00] [Schlafzimmer Rechts] Requested Move down (to 12%)
Dez 27 18:00:00 raspberrypi homebridge[25589]: [27.12.2019, 18:00:00] [Schlafzimmer Links] Requested Move down (to 12%)
Dez 27 18:00:00 raspberrypi homebridge[25589]: [27.12.2019, 18:00:00] [Esszimmer Mitte] Requested Move down (to 0%)
Dez 27 18:00:00 raspberrypi homebridge[25589]: [27.12.2019, 18:00:00] [Esszimmer Links] Requested Move down (to 0%)
Dez 27 18:00:00 raspberrypi homebridge[25589]: [27.12.2019, 18:00:00] [Esszimmer Rechts] Requested Move down (to 0%)
Dez 27 18:00:00 raspberrypi homebridge[25589]: [27.12.2019, 18:00:00] [Küche Alle] Requested Move down (to 0%)
Dez 27 18:00:00 raspberrypi homebridge[25589]: [27.12.2019, 18:00:00] [Schlafzimmer Rechts] Move request sent (312 ms), waiting 8.8s (+ 0s response lag)...
Dez 27 18:00:00 raspberrypi homebridge[25589]: [27.12.2019, 18:00:00] [Schlafzimmer Links] Move request sent (531 ms), waiting 8.8s (+ 0s response lag)...
Dez 27 18:00:00 raspberrypi homebridge[25589]: [27.12.2019, 18:00:00] [Esszimmer Mitte] Move request sent (575 ms), waiting 20s (+ 0s response lag)...
Dez 27 18:00:09 raspberrypi homebridge[25589]: [27.12.2019, 18:00:09] [Schlafzimmer Rechts] End Move down (to 12%)
Dez 27 18:00:09 raspberrypi homebridge[25589]: [27.12.2019, 18:00:09] [Schlafzimmer Rechts] Stop request sent
Dez 27 18:00:09 raspberrypi homebridge[25589]: [27.12.2019, 18:00:09] [Schlafzimmer Links] End Move down (to 12%)
Dez 27 18:00:09 raspberrypi homebridge[25589]: [27.12.2019, 18:00:09] [Schlafzimmer Links] Stop request sent
Dez 27 18:00:11 raspberrypi homebridge[25589]: [27.12.2019, 18:00:11] [Esszimmer Links] Error sending request (HTTP status code not defined): Error: socket hang up
Dez 27 18:00:11 raspberrypi homebridge[25589]: [27.12.2019, 18:00:11] [Esszimmer Links] Body: undefined
Dez 27 18:00:11 raspberrypi homebridge[25589]: [27.12.2019, 18:00:11] Error: This callback function has already been called by someone else; it can only be called one time.
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/once.js:12:13
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at BlindsHTTPAccessory.<anonymous> (/usr/local/lib/node_modules/homebridge-blinds/index.js:113:13)
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at BlindsHTTPAccessory.<anonymous> (/usr/local/lib/node_modules/homebridge-blinds/index.js:182:13)
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at self.callback (/usr/local/lib/node_modules/homebridge-blinds/node_modules/request/request.js:185:22)
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at Request.emit (events.js:189:13)
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at Request.onRequestError (/usr/local/lib/node_modules/homebridge-blinds/node_modules/request/request.js:881:8)
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at ClientRequest.emit (events.js:189:13)
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at Socket.socketOnEnd (_http_client.js:426:9)
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at Socket.emit (events.js:194:15)
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at endReadableNT (_stream_readable.js:1103:12)
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at process._tickCallback (internal/process/next_tick.js:63:19)
Dez 27 18:00:11 raspberrypi homebridge[25589]: [27.12.2019, 18:00:11] [Esszimmer Rechts] Error sending request (HTTP status code not defined): Error: socket hang up
Dez 27 18:00:11 raspberrypi homebridge[25589]: [27.12.2019, 18:00:11] [Esszimmer Rechts] Body: undefined
Dez 27 18:00:11 raspberrypi homebridge[25589]: [27.12.2019, 18:00:11] Error: This callback function has already been called by someone else; it can only be called one time.
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/once.js:12:13
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at BlindsHTTPAccessory.<anonymous> (/usr/local/lib/node_modules/homebridge-blinds/index.js:113:13)
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at BlindsHTTPAccessory.<anonymous> (/usr/local/lib/node_modules/homebridge-blinds/index.js:182:13)
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at self.callback (/usr/local/lib/node_modules/homebridge-blinds/node_modules/request/request.js:185:22)
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at Request.emit (events.js:189:13)
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at Request.onRequestError (/usr/local/lib/node_modules/homebridge-blinds/node_modules/request/request.js:881:8)
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at ClientRequest.emit (events.js:189:13)
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at Socket.socketOnEnd (_http_client.js:426:9)
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at Socket.emit (events.js:194:15)
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at endReadableNT (_stream_readable.js:1103:12)
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at process._tickCallback (internal/process/next_tick.js:63:19)
Dez 27 18:00:11 raspberrypi homebridge[25589]: [27.12.2019, 18:00:11] [Küche Alle] Error sending request (HTTP status code not defined): Error: socket hang up
Dez 27 18:00:11 raspberrypi homebridge[25589]: [27.12.2019, 18:00:11] [Küche Alle] Body: undefined
Dez 27 18:00:11 raspberrypi homebridge[25589]: [27.12.2019, 18:00:11] Error: This callback function has already been called by someone else; it can only be called one time.
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/once.js:12:13
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at BlindsHTTPAccessory.<anonymous> (/usr/local/lib/node_modules/homebridge-blinds/index.js:113:13)
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at BlindsHTTPAccessory.<anonymous> (/usr/local/lib/node_modules/homebridge-blinds/index.js:182:13)
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at self.callback (/usr/local/lib/node_modules/homebridge-blinds/node_modules/request/request.js:185:22)
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at Request.emit (events.js:189:13)
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at Request.onRequestError (/usr/local/lib/node_modules/homebridge-blinds/node_modules/request/request.js:881:8)
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at ClientRequest.emit (events.js:189:13)
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at Socket.socketOnEnd (_http_client.js:426:9)
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at Socket.emit (events.js:194:15)
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at endReadableNT (_stream_readable.js:1103:12)
Dez 27 18:00:11 raspberrypi homebridge[25589]:     at process._tickCallback (internal/process/next_tick.js:63:19)
Dez 27 18:00:11 raspberrypi homebridge[25589]: [27.12.2019, 18:00:11] Got SIGTERM, shutting down Homebridge...
Dez 27 18:00:16 raspberrypi systemd[1]: homebridge.service: Main process exited, code=exited, status=143/n/a
Dez 27 18:00:16 raspberrypi systemd[1]: homebridge.service: Failed with result 'exit-code'.
Dez 27 18:00:26 raspberrypi systemd[1]: homebridge.service: Service RestartSec=10s expired, scheduling restart.
Dez 27 18:00:26 raspberrypi systemd[1]: homebridge.service: Scheduled restart job, restart counter is at 1.
Dez 27 18:00:26 raspberrypi systemd[1]: Stopped Node.js HomeKit Server.
Dez 27 18:00:26 raspberrypi systemd[1]: Started Node.js HomeKit Server.

Setup

How do I setup this up on a raspberry pi?

Down-URL problem: can close and then open with Down-URL

Thank you for this great accessory.
My problem:
I use home kit automation to control my blinds.
But for a down request, the blind alternates its position:
If it is already down, it rises instead of doing nothing.
If it is up, it closes, as it should.
This is only happening for repeated down requests.
The up request works nice, if it is send two or more times.

So it seems, the accessory sends the up-url if the status is down, although home kit sends another down request.

Kind rerards
Jupp

Position bookmarks

Would be cool.
Like the bond plugin have the ability to open to 1, 2, 3, 4 (pick the limit you want to implement.
User sets where those positions are. Either in the settings UI or using a remember this position 1 button.
If doing up to 4 then maybe defaults
20% 40% 60% 80%
Maybe there

shade not reacting

everything show up in Homekit.....but hitting the shade up or down doesnt do anything

Annotation 2020-07-21 184308

Adding Status

I'm trying to add in a status_url, without too much success. I have two methods that I can get data back from my controller;

I can get back a 0 for close (down), and a 100 for open (up). Doing this doesn't work well:

if (this.deviceType.match(/^blind/i)) {
// state vars
this.lastPosition = 0; // last known position of the blinds, down by default
this.lastStatePartial = 0;
this.currentPositionState = 2; // stopped by default
this.currentTargetPosition = 0; // down by default

// register the service and provide the functions
this.service = new Service.WindowCovering(this.name);

// the current position (0-100%)
// https://github.com/KhaosT/HAP-NodeJS/blob/master/lib/gen/HomeKitTypes.js#L493
this.service
    .getCharacteristic(Characteristic.CurrentPosition)
    .on('get', this.getCurrentStatePartial.bind(this));

// the position state
// 0 = DECREASING; 1 = INCREASING; 2 = STOPPED;
// https://github.com/KhaosT/HAP-NodeJS/blob/master/lib/gen/HomeKitTypes.js#L1138
this.service
    .getCharacteristic(Characteristic.PositionState)
    .on('get', this.getPositionState.bind(this));

// the target position (0-100%)
// https://github.com/KhaosT/HAP-NodeJS/blob/master/lib/gen/HomeKitTypes.js#L1564
this.service
    .getCharacteristic(Characteristic.TargetPosition)
    .on('get', this.getCurrentStatePartial.bind(this))
    .on('set', this.setTargetPosition.bind(this));

HttpMulti.prototype.getCurrentStatePartial = function(callback) {
this.log("Requested CurrentState: %s", this.lastStatePartial);
if (this.status_url !== undefined) {
request.get({
url: this.status_url,
}, function(error, response, body) {
this.log("Status_URL: %s", this.status_url);
if (!error && response.statusCode == 200) {
if (body !== undefined) {
if (!isNaN(parseFloat(body)) && isFinite(body)) {
this.lastStatePartial = parseInt(body);
this.log("Got Status %s",this.lastStatePartial);
} else {
this.log("Warning, status returned isn't numeric: %s",body);
}
} else {
this.log("Warning, data returned isn't defined");
}
this.log("callback CurrentState: %s", this.lastStatePartial);
callback(null, this.lastStatePartial);
}
}.bind(this));
} else {
callback(null, this.lastStatePartial);
}
}

Any ideas?

Asking Siri to Open an already opened window sends close command

Siri responds "OK the living room window is open" but plugin sends the wrong command.

Here is the log:

Dec 21 18:12:55 raspberrypi homebridge[13383]: [2019-12-21 18:12:55] [Living Room Window] Already there: 100%, re-sending request
Dec 21 18:12:55 raspberrypi homebridge[13383]: [2019-12-21 18:12:55] [Living Room Window] Requested Move down (to 100%)
Dec 21 18:12:55 raspberrypi homebridge[13383]: [2019-12-21 18:12:55] [Living Room Window] Move request sent (32 ms), waiting 0s (+ 0s response lag)...

You may ask why I'm asking Siri to open a window that is already open. The answer is that my window may be closed in reality, because I can control it with wall switches and the plug is no longer in sync with actual status.

Parse bond plugin configuration

Thanks for this.
Nice to have
Maybe
When using the web UI
Parse the homebridge configuration file and use values from there.
The bond plugin figures out which devices are blinds and won’t show them. Could you do the same to figure out the device ID?

Populate the web settings UI for the user to confirm or change.

homebridge-bond open/hold/close

I'm using your plugin with homebridge-bond to control Somfy shades.
This is working fine, but I don't want to control it by setting the position in percentage.
How can I control it by just set it to push open, hold or stop button?

Thanks!

close option

Hello i successfully added blind accessory to my Home app. When i try to close a curtain, blind Siri is telling me that she (it) can't do that option or i can't close an APP. When i telling open blind, curtaine, it's work perfect.
Manual option works well for bouth option (up and down).
I am using Russian localization.
Do you know why?

Feature: Webhook for external movement signaling using internal height calculation

Hey there,

I have blinds, which are controlled via the Warema EWFS system. This is using 433,92 MHz radio, which I could decode and now can resend the needed commands via the aircontrol project. As this system is unidirectional, I do not have any height information and therefore I use the great height calculation feature based on timing from this plugin.

As I want to have the HomeKit controls additionally to the regular remote (which I decoded the commands from), currently I have the issue, that when using the remote, the height calculations get "out of sync".

I would like to have the height calculation at one place and have the ability to inform the plugin about external "up", "down" and "stop" commands via a webhook, so that I can receive the remote commands and feed them back into the plugin to update to the correct height.

Currently I'm investigating how to proper receive and decode the remote commands automatically. Meanwhile I would be happy to get some feedback to this feature request and if this is the proper way to do it or if there's a better one I'm not aware of.

Thanks!

Integrate native Tasmota support

Hey,
first of all: thank you for your very nice plugin!

Would it be possible for you to implement this plugin "the tasmota way"? Could support you if it is necessary with all the details.

Main differences between it and your plugin:

  • Responses are JSON
  • always GET requests
  • the movement times are set in the firmware / the device itself
  • controlling / moving by giving percentage values to the endpoint

Thank you.

Kind Regards

Algorithm for blind movement as a function of distance and time

Inspired by this discussion #41 I'm taking a stab at a physics-based equation for determining blind movement.

This YouTube seems like a good first start: https://www.youtube.com/watch?v=UJF_34TSAwQ

Initial results seem promising, if the physics interpretation are correct, although it doesn't account for gravity and I'm not quite sure how to do that yet.

Download file

Background

It's based on the following parameters:

  • Mass of blind per unit height
  • Mass of any weight at the bottom of blinds (e.g., most blinds have some kind of weight at the bottom)
  • Total height of blinds
  • Time for blinds to move from bottom to top

I'm attaching a draft Excel sheet here, which is set up for both Imperial and Si units.

How to Use

To use it, first input the following parameters. I estimated them in this case.

Screen Shot 2020-07-01 at 6 18 39 PM

Then, review the data table/graph below.

Screen Shot 2020-07-01 at 6 15 18 PM

Finally, to perform a specific calculation, just input the starting and ending %.

image

Stop command is repeating the last command

Hi,
I have been using your plugin for a long time now and was wondering if you could suggest a way to use it on my - not so smart - blinds.
So my problem is that in my case I have no STOP command. I can stop the blinds by repeating the last command. So if the blinds are going up and I want to stop them, I have to issue another up command, and if they are going down, I have to issue a down command to stop them.

Could this be somehow implemented?

Thank you and kind regards.
Peter

Adding CMD support?

This is a terrific plugin that comes very close to doing what I need, but missing a bit of flexibility.

Ideally, I'd like to have the ability to have the plugin call a command line action for up / down, similar to the homebridge-cmd plugin, where I can specify the up_cmd and down_cmd instead of an up_url and down_url.

In my use case, I have HTTP-accessible blinds, but they're a bit more complex than what a simple GET/POST can do. I have a command-line script that can raise lower different blinds, and I'd like to be able to call it instead of using HTTP.

Alternately...if there was an option to dictate the payload for a POST, that may work as well. Specifically, my blinds setup would need a command transmitted in the content of a POST payload. The up_url and down_url would be identical, and the POST payload would be something like "blind 1 up" or "blind 1 down", depending on the action.

So...long way of asking can you either add support for command-line script execution in place of an up / down URL? Alternately, can you add support to customize what content is sent in a POST?

Thanks!

Home app showing obstacle detected

Hi,
few days ago I noticed that the home app shows obstacle detected on some of my blinds? When does this occour? Is this a bug or a feature? Has it something to do with timing? Does the plugin set this?
Thanks

Related blinds together in groups

Awesome plugin, works great with Bond Bridge to control my Somfy shades!

One small UX quirk I ran into -- consider a Somfy controller set up:

  • 1: shade 1
  • 2: shade 2
  • 3: shade 3
  • 4: all shades

The group (4) above does not track state correctly in homebridge-blinds because AFAIK Somfy/Bond do not report position. If you close 1, 2, and 3 then 4 will still say "open".

We could extend the config to support shaded groupings. Perhaps something like:

[
  ...
  {
     "name": "Shade 1",
     "up_url": "http://...",
     "group": "All Shades"
  },
  {
     "name": "Shade 2",
     "up_url": "http://...",
     "group": "All Shades"
  },
  {
     "name": "Shade 3",
     "up_url": "http://...",
     "group": "All Shades"
  },
  {
     "name": "All Shades",
     "up_url": "http://..."
  }
  ...
]

When shades 1, 2, or 3 are interacted with they'd check to see if group is defined and if so, update some internal state tracking which gets pushed to HomeKit.

Would need to consider what the expected behavior is for partial open/close. Perhaps could take the max() of all shades in the group as the value. Or just force any partial value to 0% or 100% in the slider control if the user chooses a middle option.

Blinds respond 50% of the time

Under Apple Homekit automation, I noticed the blinds will respond open/close half the time.

I have to manually go to the HOME app to open and close

Plugin seems to send incorrect commands

Hello!
I am facing an new issue for a few days:
After upgrading my Jbmedia Light Manager to the latest Firmware, sending blind commands in a row make the plugin unstable.

For example, I launch a scene in Homekit to shut down 3 blinds.
With any old Light Manager FW, it was working ok, no problem.
Since latest FW, only 1 out of the 3 blinds shuts down properly and homebridge-blinds plugin is sending DOWN commands to 1 of the blinds every second endlessly. Restaring Homebridge is the only way to recover to normal behaviour.
During that, I get some endless spinning weels running on the 3 blinds tiles in Homekit.

I can also reproduce the issue by tapping manually for example DOWN on blind 1 and then very quickly (less than 1 sec after) after DOWN on blind 2. Then only blind 1 reacts and plugin sends endlessly DOWN commands every seconds.

Please let me know how we could investigate this issue... :)

Updating Status

So, I've hit a wall and could use some ideas. To get status for a light, for example, I do this:

this.service
    .getCharacteristic(Characteristic.On)
    .on('get', this.getCurrentState.bind(this))
    .on('set', this.setCurrentState.bind(this));

this.service
    .getCharacteristic(Characteristic.Brightness)
    .on('get', this.getCurrentState.bind(this))
    .on('set', this.setCurrentStatePartial.bind(this));

and have this:

HttpMulti.prototype.getCurrentState = function(callback) {
this.log("Requested CurrentState: %s", this.lastState);
if (this.status_url !== undefined) {
request.get({
url: this.status_url,
}, function(error, response, body) {
this.log("Status_URL: %s", this.status_url);
if (!error && response.statusCode == 200) {
if (body !== undefined) {
if (!isNaN(parseFloat(body)) && isFinite(body)) {
this.log("Got Status %s",body);
this.lastState = body;
} else {
this.log("Warning, status returned isn't numeric: %s",body);
}
} else {
this.log("Warning, data returned isn't defined");
}
this.log("callback CurrentState: %s", this.lastState);
callback(null, this.lastState);
}
}.bind(this));
} else {
callback(null, this.lastState);
}
}

And I see this in the log:

[Room Light] Requested CurrentState: 0
[Room Light] Requested CurrentState: 0
[Room Light] Status_URL: http://xxx
[Room Light] Got Status 20
[Room Light] callback CurrentState: 20
[Room Light] Status_URL: http://xxx
[Room Light] Got Status 20

But in the Home app, it just says 'No Response'.

iOS 14 issue

I have just installed iOS 14!
I have in total 4 configured blinds. For two of them I get “Window obstructed” which isn’t right and there is no way for the plugin to be aware if such situation existed.

-image

Let me know if you need me to provide any more data.

All the best

position_jsonata not working

In my setup, jsonata doesn't seem to work as intended, as changes not made through homebridge don't reach homebridge. Please have a look at the following screenshots explaining my issue.
This first one shows the logs, where a position of 64% is requested but the openLevel returned shows that the blinds are actually at 21%.
CleanShot 2020-12-28 at 13 03 34@2x
This following screenshot shows my setup, which should find the "openLevel" in the returned JSON. Please let me know where I'm missing something.
CleanShot 2020-12-28 at 13 07 45@2x

If you need anything else to help please let me know.
Thank you

Externally set position

@zwerch , with your nice and helpful plugin I have my window electric shutters controlled under homekit! With your recent updates the plugin has greatly been improved and after extended testing I have no issues at all.

I have one question though and wanted to discuss with you. My shades are controlled by homekit, by wall switches and by remotes. If I control the shades by any other mean than homekit, your plugin gets out of sync, meaning the plugin may report wrong position/state in homekit and that's expected because it can't be aware of what's happening in the rest system.

I was thinking how could we overcome this situation.

One idea would be to use wireless contact sensors. With the help of those sensors, we could retrieve shutter position.

But the question then would be, how could we set the position manually? Perhaps if your plugin exposed an web server and allowed to receive http calls, it would be possible.

Thank you

Receive state of a given blind accessory via webhook

Hello!
I have set a webhook port for one of my blind accessories:
"webhook_port": 51828
and I am able to make the blind to switch UP in Home app when calling the url http://192.168.33.43:51828/?pos=100

But I have 4 blinds and I want to be able to change their state 1 by 1 via the webhook.
Can I address a given blind via some extra parameter in the url?
Should I set the same webhook port to the 4 blind accessories?

Thanks in advance!
Genfersee

Any way to group multiple HTTP requests in only one?

Hello! I'm testing this cool plugin to control my blinds making HTTP requests to python API that I'm developing and is running on a raspberry connected to blind remote controller using GPIO's... I was wondering if it's possible to do this:

When for example I say to Siri to open or close all blinds from specific zone, every accessory from this zone makes its own HTTP request.. is there any way to group all these requests in only one request? because i'm facing a problem to handle multiple requests at the same time...

I should probably do a queue system or something similar to handle all the requests one by one, because for each request I have to "press" a specific button sequence on the controller in order to control each blind. Thank you in advance.

Not an issue but an question

Hi, thank you for this plugin. I am new to homebridge. I do know how to use the plugins, but I am getting stuck on altering them. I am hoping that you can and will help me to controle my environment with homebridge. Here is my situation:

since your plugin voor de blinds kind of resembles wat I need voor a dimmable lightbulb. Sounds strange but here is my situation:

I have created an arduino based device which can control 64 relays bij a HTTP command.

URL format: http://0.0.0.0/?XpYnnnn
X = Board (A-B-C-D-E-F-G-H)
p = Pin number (0-7)
Y = Action to perform

  • H = Relay OFF
  • L = Relay ON
  • T = Toggle (ON > OFF & OFF > ON)
  • P = Pulse nnnnn milliseconds uses toggle

I can ONLY controle the light via a external switch: with two touch switches ON/+ and OFF/-
each time a set of two relais is wired to the touch switches. When I:

give a short puls (200 ms) to the relay which controles the ON switch, the light goes ON
give a short puls (200 ms) to the relay which controles the OFF switch, the light goes OFF
keep the ON switch pressed (either bij a long puls or set the relay ON (with an URL) and after a certain time set the relay OFF (with an URL)), the light will turn brighter
keep the OFF switch pressed (either bij a long puls or set the relay ON (with an URL) and after a certain time set the relay OFF (with an URL)), the light will get less brighter
so I need to create a plugin with an config.jsn -file with parameters:

ON URL
OFF URL
duration time in ms (from fully off to fully on and visa versa )
brighter relay ON URL
brighter relay OFF URL
less brighter relay ON URL
less brighter relay OFF URL
Because I want to create a dimmable lightbulb in Homekit

I realize I ask for a lot, but can and will you help met with that.

Kinds regards,

Leon

Set current state with a 'state_url'

Hi,

Currently, even when the target position of the blinds is specifically set through an up/down URL (e.g. http://1.1.1.1/set?target_position=100) and the current position of the blinds is specifically received through a position URL (e.g. http://1.1.1.1/get?current_position), the state (opening, closed, stopped) of the blinds is still emulated using 'motion_time'.

As per the README:

Ensure that the motion time is configured properly, even when "position_url" is set, as it is used to obtain an estimate of blind position to avoid multiple web requests to the position_url. (After the estimated position is reached, the position will be confirmed).

As my blinds take longer to open and close at certain heights, the emulated tracking does not perform very well, and the blinds report that they are still opening/closing a few seconds after they have stopped in real life. However I have the ability to detect the state of my blinds over http, (i.e. http://1.1.1.1/get?current_state), such that:

  • 0: the blinds are closing
  • 1: the blinds are opening
  • 2: the blinds are stopped

Just wondering if an optional "state_url" would be appropriate, where the current state (opening, closing, stopped) can be queried at an interval by the plugin when opening/closing the blinds. This could co-exist with the current "position_url" and provide more accurate tracking for the blinds state in Homebridge.

Also, if this is a bad idea or there are other approaches please let me know!

Thanks!

Toggle URL

Hello,

I have some Somfy blinds. Would it be possible you add some parameter to enter a « toggle_url »? Then I could avoid to install an extra plugin to add buttons for toggle url.

Thanks in advance!

status / http-return ?

Hi zwerch,

does your plugin require a return value from the http-server? The script seems to work, but the status hangs in iOS 10.

Thanks!
Michael

multi device support

I have a httpmulti accessory that has been depreciated by the latest IOS update. It might be somewhat straightforward to adapt this to include multiple different object types. What do you think?

Stop command?

Hey,

As you can see, I'm changing the titles as I resolve issues I'm having.

First of all, great plug-in! thanks for making it.

Is there a way to tell it "Full opening takes x amount of seconds" and then have it work percentages according to that time you have provided?

It seems that to stop the blind, if I set it at 90%, it uses the opposite command to try to stop the blind.

So if it is open, and I set it at 90% it goes down to 90%, then it goes back up. Is there a way to code a stop command?

[FEATURE] Eve App 4.2 Issue with homebridge-blinds

The latest Eve for HomeKit App v4.2 is causing issues with several Homebridge Plugins.
They changed something so that the serial number of a device is linked somehow in the background. This was not with previous Eve versions.
Problems causing now like described here.
homebridge/homebridge#2503
So all devices/switches from homebridge-blinds can't be sorted anymore and can't get an icon for each device separately.

Do you see a solution to fix this "Eve" Issue, by changing something in your plugin?

Other plugin developers like @nicoduj homebridge-harmony already fixed the Eve Issue #249.
@pponce with homebridge-script2 did a fix #25 by adding "unique_serial": which also was a great and working solution.

homebridge-blinds Plugin is indispensable for me and I would not want to miss it.

Thanks again for your work and the time you are investing generally.

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.