ztalbot2000 / homebridge-cmd4

CMD4 Plugin for Homebridge - Supports ~All Accessory Types & now all Characteristics too
Apache License 2.0
145 stars 14 forks source link

Support for custom accesoires #103

Closed CaseyRo closed 3 years ago

CaseyRo commented 3 years ago

Describe the solution you'd like: I've been searching for this and have been doing a lot of trial / error things, pretty much to be able to re-produce this:

image

Describe alternatives you've considered:

You, @ztalbot2000 would be my life saver! It also fits really well in your plans/thoughts on cmd4, and just is great to make really nice and custom accessoires for homebridge available.

Any thoughts?

p.s. I'm aware of the limitations, and the fact I'm probably edge case looking for these kinds of solutions, but home+ suppports it, as does Eve...

ztalbot2000 commented 3 years ago

Hi,

I think in the ToDo's there is a mention of supporting custom characteristics. I'll certainly put this as a feature if you would like. Cmd4 does have the ability to change props for things like temperatures, but not to the degree you would need ;-) The only reason I never pursued this further was that while you could make custom characteristics, the App that displays it would not know what to do with it. This is why there are usually custom Apps. If you still think you could use the feature, let me know. I'll see what I can do. I have another feature that I'm working on, but you never know if I can squeeze it in somewhere.

Ttyl, John Talbot

On Thu, Apr 8, 2021 at 10:40 AM Casey @.***> wrote:

Assigned #103 https://github.com/ztalbot2000/homebridge-cmd4/issues/103 to @ztalbot2000 https://github.com/ztalbot2000.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/ztalbot2000/homebridge-cmd4/issues/103#event-4569124467, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBCX5XSQLAR3PHWLF57FDTHW57RANCNFSM42TBDO7A .

CaseyRo commented 3 years ago

@ztalbot2000 very much appreciated - just to share some thoughts with you why I'd like to use a 'custom accesoiry' :

It's a bit like an always up to date and visible 'status' accesoiry.

Once speaker accessoires support these characteristics things will probably change anyway - but it's the three use cases I have currently.

No rush on this, let me know if I can help you test!

ztalbot2000 commented 3 years ago

Hi Casey,

I will work on it and thank you for offering to test.. I will surely take you up on that. I might have something in a week or so,

Ttyl, John

On Thu, Apr 8, 2021 at 11:01 AM Casey @.***> wrote:

@ztalbot2000 https://github.com/ztalbot2000 very much appreciated - just to share some thoughts with you why I'd like to use a 'custom accesoiry' :

  • As a user I want to see what song is playing on my Roon audio system, and in what zone so I don't need to open a different app to do this
  • As a user I want to see what the state of my house currently is, so I don't have to do that in a different app
  • As a user I want to see the bitcoin valuation

It's a bit like an always up to date and visible 'status' accesoiry.

Once speaker accessoires support these characteristics things will probably change anyway - but it's the three use cases I have currently.

No rush on this, let me know if I can help you test!

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/ztalbot2000/homebridge-cmd4/issues/103#issuecomment-815895801, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBCX3V2HOWJHNXGIVAS4TTHXAMHANCNFSM42TBDO7A .

ztalbot2000 commented 3 years ago

Question for you,

If for this feature you had to define your characteristic like one of them in /usr/lib/node_modules/homebridge-cmd4/lib/CMD4_ACC_TYPE_ENUM.js (line 292), would you be willing to do that? I'd put some checking around it of course, but what I'm getting at is that internally I could create a function that appends your new characteristic to my array. I'm just thinking of ways to implement this and would like your opinion.

thanks, John Talbot

CaseyRo commented 3 years ago

@ztalbot2000 yeah for me this would be fine - I’ve seen the guys from https://github.com/NRCHKB/node-red-contrib-homekit-bridged using a similar way to assign custom characteristics to an accesoiry, so for me it’s not unfamiliar.

In the end it’s something that ‘tinkerers’ would benefit by most, but we’re already on that level with your plugin I guess!

ztalbot2000 commented 3 years ago

Hi Casey,

That is the first I've ever heard of Node-Red. I appreciate the link. I'll stick with Homebridge. I know I have one enhancement request for config-UI-x support. I started it more than once, but always get side-tracked. It's a monstrous task that I wanted to automate via the tables I showed you. I'll continue down the route I mentioned to you, unless I think of something better.

Cheers, John

On Fri, Apr 9, 2021 at 2:07 AM Casey @.***> wrote:

@ztalbot2000 https://github.com/ztalbot2000 yeah for me this would be fine - I’ve seen the guys from https://github.com/NRCHKB/node-red-contrib-homekit-bridged using a similar way to assign custom characteristics to an accesoiry, so for me it’s not unfamiliar.

In the end it’s something that ‘tinkerers’ would benefit by most, but we’re already on that level with your plugin I guess!

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/ztalbot2000/homebridge-cmd4/issues/103#issuecomment-816434441, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBCX2AJNQXA7RPFIG6OKLTH2KTJANCNFSM42TBDO7A .

CaseyRo commented 3 years ago

@ztalbot2000 wonderful John - and nodered is something you can get sidetracked into really easily, don't be tempted 😉

I'm here if you need a tester!

ztalbot2000 commented 3 years ago

Hi Casey,

Github has your feature. I did not push it to npm and have not written the documentation for it either. Here is the test config.json I was working with. I'm hoping you can figure it out for now. It is pretty much as we discussed { "bridge": { "name": "Homebridge 1938", "username": "0E:DA:6A:09:19:38", "port": 51431, "pin": "444-44-444" }, "platforms": [ { "platform": "Cmd4", "outputConstants": false, "restartRecover": true, "Cmd4_Mode": "FullyPolled", "statusMsg": true, "QueueStatMsgInterval": 100, "Definitions": [ { "type": "PointX", "description": "An X Coordinate", "props": { "format": "uint32", "minValue": 0, "minStep": 1, "perms": [ "ev", "pr", "pw" ] } } ], "accessories": [ { "type": "Switch", "name": "PS_4", "Cmd4_Mode": "Always", "PointX": 3267, "on": false, "polling": [ { "characteristic": "On", "interval": 50 }, { "characteristic": "PointX", "interval": 5 } ], "state_cmd": "node .homebridge/Cmd4Scripts/AnyDevice.js" } ] },

    {
        "name": "Config",
        "port": 9090,
        "platform": "config",
        "ssl": {
            "key": "ssl/private/SixtyFiveStableWay.key",
            "cert": "ssl/private/SixtyFiveStableWay.crt"
        }
    }
]

}

I'm going for a snooze, so I hope this works for you.

ttyl, John

ztalbot2000 commented 3 years ago

I did release this as an npm package. It was picked up as part of 1.5.1.

CaseyRo commented 3 years ago

@ztalbot2000 thanks man, much appreciated! Sorry for my lack of response, work as taken most of my screen time these days. The weekend starts in a bit, I'll look into it! Thanks again!

ztalbot2000 commented 3 years ago

You're welcome!

I did a bit of documentation on the subject. It was really nothing more than what I already told you. It's a nice addition to Cmd4. I hope it works for you and if it does, please tell me all about it.

Take care, John

On Fri, Apr 16, 2021 at 9:36 AM Casey @.***> wrote:

@ztalbot2000 https://github.com/ztalbot2000 thanks man, much appreciated! Sorry for my lack of response, work as taken most of my screen time these days. The weekend starts in a bit, I'll look into it! Thanks again!

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/ztalbot2000/homebridge-cmd4/issues/103#issuecomment-821183104, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBCXYWARWPI4YMESACJE3TJA4OJANCNFSM42TBDO7A .