dxdc / homebridge-blinds

:sunrise: Homebridge Plugin to control my blinds over HTTP
https://www.npmjs.com/package/homebridge-blinds
ISC License
54 stars 25 forks source link

Error message #35

Closed roberkane212 closed 4 years ago

roberkane212 commented 4 years ago

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

dxdc commented 4 years ago

@roberkane212 I can try to help if you share your config, but it sounds like a configuration issue with Bond. Most likely, you are using the wrong method (should be PUT), the wrong deviceId/URL, or the wrong token.

roberkane212 commented 4 years ago

@dxdc Both device ID and token are correct, so is the IP address is right as well. I’m currently using homebridge bond with no issues. My config is { "accessory": "BlindsHTTP", "name": "Dining Room Shades", "up_url": "http://192.168.1.45/v2/devices/ZZCC62021/actions/Open", "down_url": "http://192.168.1.45/v2/devices/ZZCC62021/actions/Close", "http_method": { "body": "{}", "headers": { "BOND-Token": "6f808570db188921" }, "method": "PUT" }, "success_codes": [ 204 ], "motion_time": 11000, "response_lag": 1000, "trigger_stop_at_boundaries": false

dxdc commented 4 years ago

@roberkane212

If you have jq installed, save this and run this shell script. (If not, just install jq first). I think your device id is wrong. At least, all of my device id's are lowercase.

#!/bin/sh

# CONFIGURE BOND_IP AND BOND_TOKEN TO MATCH YOUR CONFIGURATION
BOND_IP="192.168.1.45"
BOND_TOKEN="6f808570db188921"

if ! [ -x "$(command -v jq)" ]; then
  echo 'Error: jq is not installed.' >&2
  exit 1
fi

BOND_DEVICES=$( curl -s "http://${BOND_IP}/v2/devices" -X GET -d "{\"_token\": \"${BOND_TOKEN}\"}" | jq -r 'keys[]' | grep -v '_' )

while read -r line; do
   DEVICE_DETAILS=$( curl -sH "BOND-Token: ${BOND_TOKEN}" "http://${BOND_IP}/v2/devices/${line}" | jq '.name' )
   echo "${DEVICE_DETAILS} ${line}"
done <<< "${BOND_DEVICES}"
roberkane212 commented 4 years ago

@dxdc i think you might be right I think I used bond token not device token

roberkane212 commented 4 years ago

@dxdc is there anyway to control percentage? My remote is a hold button remote to make the blinds open all the way. So I literally have to say open blind 10 times to get the blinds all the way open

dxdc commented 4 years ago

is there anyway to control percentage

See https://github.com/dxdc/homebridge-blinds#blinds-position

My remote is a hold button remote to make the blinds open all the way. So I literally have to say open blind 10 times to get the blinds all the way open

Didn't understand this. It just emulates what Bond is doing (or, another HTTP) so I'm not sure what you're after.

Is everything else working?

roberkane212 commented 4 years ago

Yes everything is working. Was just wondering if you have added blind percentages or position. For instance if I hit the accessory in HomeKit or say hey Siri open blinds it just opens a little. Was just wondering if there was something I could do to make it open all the way or close all the way. Without have to say hey Siri 10 times or having to open and close the blind in HomeKit to just get it to close or open all the way. If not I get it, was just hoping to get it to work like normal blinds having the ability to change position percentage in HomeKit

dxdc commented 4 years ago

Yes everything is working

OK great. Will close the issue then.

if I hit the accessory in HomeKit or say hey Siri open blinds

You can set the position. This is built into HomeKit. image

dxdc commented 4 years ago

BTW, if this isn't working, make sure it's working properly with Bond.

You can set the position. This is built into HomeKit.

I also noticed you don't have stop_url set in your config. You should probably add this, it's useful in these situations because it will be able to stop the blinds movement when it hits a specific position.

roberkane212 commented 4 years ago

@dxdc i don’t have a stop button to add to the url

dxdc commented 4 years ago

i don’t have a stop button to add to the url

I'm not sure then how you expect this plugin to achieve a specific position then, if your own remote is not capable of it?