anthonywebb / homebridge-cbus

CBus plugin for homebridge
MIT License
35 stars 20 forks source link

Shutters #72

Open RickHOZ opened 6 years ago

RickHOZ commented 6 years ago

Hi Anthony,

As I have said in my previous message I am far from an experienced programmer.

I have run into an issue using the accessory "shutter"

It does work to open and close the curtains but it is reporting status in the reverse.

i.e. When showing open the curtains are actually closed and vice versa.

So I use the following:

{ "type": "shutter", "id": 63, "name": "Master Suite Shear", "invert": "false"},

and all works accept that the status in reversed.

I also tried

{ "type": "shutter", "id": 63, "name": "Master Suite Shear", "invert": "true"}, Thsi in fact did not work at all.

I'm sure this is a quick fix and I am just not looking at the problem correctly.

Sorry if this is a newbie basic mistake. Love your work and I'm just so happy I have managed to get a lot to work so far.

Rick

anthonywebb commented 6 years ago

I think @simonhac did the work on the shutters, perhaps he can chime in here. I dont have any shutters on my network yet.

RickHOZ commented 6 years ago

Hi Anthony, thanks.

Can you tell me where the accessories file is located on the Server after the installation is completed? In the shutter accessory file itself, it does talk about reversing some numbers but I can't locate the shutter accessories file on the server to try changing it.

anyway, hopefully, @simonhac will pint me in the right direction. Thanks to everybody who has been working on this.

RickHOZ commented 6 years ago

ok, spent some more time on this today after I was successful in getting nearly everything working the I way I wanted it with CBUS and ELKM1.

So using my limited knowledge I was still unable to locate where I would make changes to the shutter accessory to be able to attempt to fix my issue:

A little bit more detail.

At the moment I have "shutter" opening and closing one set of curtains however everything is in reverse.

i.e. Hey SIRI, Open Curtains = Close Curtains and visa versa. The status information in the Home app is also showing everything in reverse. Open when actually closed.

I am trying to fix this one before I even attempt to integrate anymore of the curtains and blinds in the house.

If anybody has any suggestions it would be appreciated.

Thanks in advance for any assistance.

PhilPearson commented 6 years ago

Assuming you installed everything using 'npm -g' your files would most likely be in '/usr/lib/node_modules/homebridge-cbus/accessories/' Overwrite these files with your own changes then restart homebridge to apply.

Invert appears to be working for me. Log files will show the following if you have "invert": "true" set 2017-11-04T11:06:10.619Z cbus:accessory shutter Blinds //EXAMPLE/254/56/145 translate 0 inverted to 100%

RickHOZ commented 6 years ago

Hi Phil, Thanks, I follow that path and can't find the files outlined. Now when I did the install I seem to remember doing what you outlined above. i.e. npm -g "install file name" So not sure what I cant find them. ( For information I am on a Mac Mini just in case that makes a difference) p.s. I also used Homebrew if that helps.

RickHOZ commented 6 years ago

Hi Phil, Ok after some searching I found it under

usr/local/lib/node_modules/homebridge_cbus/accessories

I also set inverted to "true" which gets it working correctly as fas as SIS is concerned and how it reacts. Thanks for that,( I thought I had done this previously but maybe I was rushing )

However one further issue, in the Home app it is still showing as reversed.

Going to see if I can work out how to change that in the accessory file.

RickHOZ commented 6 years ago

Well, well. Not sure what I have done but I have broken something when playing around with the shutter accessories file.

I changed a few things in the shutter-accessory.js file and then I simply replaced the one located at /usr/local/lib/node_modules/homebridge-cbus/accessories with my updated one.

This did not work so I copied back the original file and since then I keep getting errors.

I have tried deleting the whole homebridge-cbus folders I have done a reinstall then I even did the new update to 0.6.4 that was just released.

I have rerstarted the computer, NPM and Homebridge

Any suggestions would be appreciated.

So the errors are below:

/usr/local/lib/node_modules/homebridge-cbus/accessories

cbus:client sent command '[101] get //SAMARA/254/56/63 level' +5s cbus:client rx response { commandId: 101, code: 401, matched: false, processed: false, type: 'response', raw: '[101] 401 Bad object or device ID: //SAMARA/254/56/63 (Object not found)' } +2ms cbus:client matched request '[101] get //SAMARA/254/56/63 level' with response '[101] 401 Bad object or device ID: //SAMARA/254/56/63 (Object not found)' (0 pending requests) +0ms cbus:client sent command '[102] get //SAMARA/254/56/64 level' +1ms cbus:client rx response { commandId: 102, code: 401, matched: false, processed: false, type: 'response', raw: '[102] 401 Bad object or device ID: //SAMARA/254/56/64 (Object not found)' } +1ms cbus:client matched request '[102] get //SAMARA/254/56/64 level' with response '[102] 401 Bad object or device ID: //SAMARA/254/56/64 (Object not found)' (0 pending requests) +0ms cbus:client sent command '[103] get //SAMARA/254/56/83 level' +16ms cbus:client sent command '[104] get //SAMARA/254/56/144 level' +0ms cbus:client rx response { commandId: 103, code: 401, matched: false, processed: false, type: 'response', raw: '[103] 401 Bad object or device ID: //SAMARA/254/56/83 (Object not found)' } +1ms cbus:client matched request '[103] get //SAMARA/254/56/83 level' with response '[103] 401 Bad object or device ID: //SAMARA/254/56/83 (Object not found)' (1 pending requests) +0ms cbus:client rx response { commandId: 104, code: 401, matched: false, processed: false, type: 'response', raw: '[104] 401 Bad object or device ID: //SAMARA/254/56/144 (Object not found)' } +0ms cbus:client matched request '[104] get //SAMARA/254/56/144 level' with response '[104] 401 Bad object or device ID: //SAMARA/254/56/144 (Object not found)' (0 pending requests) +0ms

RickHOZ commented 6 years ago

Sorry, I'm also getting these errors in npm ( Attached screenshot) screen shot 2017-11-05 at 2 37 08 pm

anthonywebb commented 6 years ago

I'm not following what the "npm restart" is attempting to do, it looks as if you might be in the wrong directory to be running that npm command anyway

RickHOZ commented 6 years ago

Hi All,

Anthony, I was simply trying to restart npm to see if it resolved my issue, the issue is I am very much a novice at all of this and finding it difficult to get my head around some of the systems.

I apologise for making it very difficult, I am trying to resolve the issues by myself and I seem to get rid of a few. This one has me stumped, and I seem to have now broken everything with regards to C-Bus I now get an error on everything to do with the Cbus set up.

The ELKM1 plugin is still connecting to the ELKM1 Panel and I am receiving feedback and I can control devices on the network with the ELKM1 system but I am getting the following errors on all of the CBus comms.

I am seeing this error in the log and I wondering if I have somehow broken the connection between the homebridge.cbus and C-Gate?

What is also weird is if I open the C-Gate from another machine ( I am running C-Bus Toolkit on a Vmware partition on my Mac) and i am remotely connected into C-Gate then I restart Homebridge on the Mac Mini Server that is hosting Homebridge then the error below disappears. But the other error for "bad object or device ID" is still occurring.

However, in either instance, I can still longer control devices on the C-Bus.

Sorry, and any help would be appreciated.

Error:

cbus:client sent command '[100] dbgetxml //SAMARA' +160ms cbus:client rx response { commandId: 100, code: 440, matched: false, processed: false, type: 'response', raw: '[100] 440 There is no tag database to perform this operation on' } +4ms cbus:client matched request '[100] dbgetxml //SAMARA' with response '[100] 440 There is no tag database to perform this operation on' (0 pending requests) +1ms cbus:client rx unparsable line: '[100] 440 There is no tag database to perform this operation on', error: TypeError: Cannot read property 'content' of undefined cbus:client at Object.client.getDB.result [as callback] (/usr/local/lib/node_modules/homebridge-cbus/lib/cgate-database.js:58:32) cbus:client at CBusClient._resolveResponse (/usr/local/lib/node_modules/homebridge-cbus/lib/cgate-client.js:594:12) cbus:client at CBusClient._socketReceivedLine (/usr/local/lib/node_modules/homebridge-cbus/lib/cgate-client.js:635:10) cbus:client at Carrier. (/usr/local/lib/node_modules/homebridge-cbus/lib/cgate-client.js:175:9) cbus:client at emitOne (events.js:116:13) cbus:client at Carrier.emit (events.js:211:7) cbus:client at /usr/local/lib/node_modules/homebridge-cbus/node_modules/carrier/lib/carrier.js:24:12 cbus:client at _combinedTickCallback (internal/process/next_tick.js:131:7) cbus:client at process._tickCallback (internal/process/next_tick.js:180:9) +1ms

RickHOZ commented 6 years ago

Hi All,

I just found the following in the log under C-gate when I restarted c-gate and attempted to connect again: Not sure what the last line of text refers to.

20171105-185635 751 //SAMARA - Tag information changed at tag address: //SAMARA/Installation oldtag: null newtag: null 20171105-185636 742 //SAMARA/254 26e6d9f0-a435-1035-aea3-a31966bec0d3 Network created type=CNI address=192.168.1.7:10001 20171105-185807 803 cmd5 - Host:/127.0.0.1 opened command interface from port: 49358 Serialio Library: version 10.1.2: build 9221 Copyright (c) 1996-2012 Serialio.com, All Rights Reserved. os.name="Mac OS X" os.arch="x86_64" java.lang.UnsatisfiedLinkError: no jspMacOSX in java.library.path: Check that native library jspMacOSX is in proper directory

RickHOZ commented 6 years ago

Hi Al,,

Ok, seemed to work through the issue, reloaded the Cbus project in C-gate on the Server and got it back up again. Don't know how I broke it, but I am now back up again. Phew.