autoSteve / acMqtt

CBus Automation Controller: Home Assistant, MQTT, Philips Hue and more (for the SHAC/NAC/AC2/NAC2)
GNU General Public License v3.0
15 stars 6 forks source link

Refactor key parts into user library? #32

Closed geoffwatts closed 6 months ago

geoffwatts commented 7 months ago

Steve,

I wonder if it's worth considering taking the common parts of your entire bag of scripts (and the zigbee stuff), and roll it up into a user library?

For example, walking through the list of cbus groups and extracting tags and values, updating that in memory, your new approach to using localbus - all probably generalisable?

Just a thought!

autoSteve commented 7 months ago

Maybe.

Another job for today is to implement localbus for acMqtt. The Hue bridge is hopefully dead to me soon, so what-evs for that one.

autoSteve commented 7 months ago

Yeah, not strong on this idea actually, after thinking it through. Even though I love it.

If it were just you and I evolved Lua folks using these scripts then I'd whole heartedy agree. In fact I started out with a whole bunch of things in a user library then pulled them back into main code to simplify deployment for others. Deploy your Zigbee script? One resident to copy/paste. My MQTT send receive script? One resident to copy/paste. Using both? Two residents only. Not two residents and a user library, with your script scraped off your github, and my user library scraped from mine or a fork on yours.

I did actually update the Hue code for localbus. So much for "what-evs"... It irked me, but my shiny new coordinator has still not arrived. It's in-country, picked up by carrier, then ... crickets. Aaaargh! Stupid Easter shenanigans. Anyone would think that someone might have died (and been resurrected) around this time...

geoffwatts commented 7 months ago

Haha evolved Lua folk - not me, but I am starting to appreciate it!

Yes think you're right re the refactor - the user scripts UI in the controller isn't exactly straightforward. I got very confused when I installed a modbus slave example from Clipsal and the userscript was empty (then realised it was luajit compiled, then realised you can decompile them, then realised it was essentially a logicmachine KNX example with mild changes for cbus).

I have a spare USB coordinator, shame I'm in WA or you could definitely have it! Can also vouch for the SLZB-06 poe coordinator: https://smlight.tech/product/slzb-06/ - that came in a couple of days for me.

On Wed, Apr 3, 2024 at 10:05 PM Steve Saunders @.***> wrote:

Yeah, not strong on this idea actually, after thinking it through. Even though I love it.

If it were just you and I evolved Lua folks using these scripts then I'd whole heartedy agree. In fact I started out with a whole bunch of things in a user library then pulled them back into main code to simplify deployment for others. Deploy your Zigbee script? One resident to copy/paste. My MQTT send receive script? One resident to copy/paste. Using both? Two residents only. Not two residents and a user library, with your script scraped off your github, and my user library scraped from mine or a fork on yours.

I did actually update the Hue code for localbus. So much for "what-evs"... It irked me, but my shiny new coordinator has still not arrived. It's in-country, picked up by carrier, then ... crickets. Aaaargh! Stupid Easter shenanigans. Anyone would think that someone might have died (and been resurrected) around this time...

— Reply to this email directly, view it on GitHub https://github.com/autoSteve/acMqtt/issues/32#issuecomment-2034714214, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADIDUC7QIOSHLZB3JQRHUDY3QLDBAVCNFSM6AAAAABFQ74P5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZUG4YTIMRRGQ . You are receiving this because you authored the thread.Message ID: @.***>

autoSteve commented 7 months ago

Shame I love Tube's work so much. United States. Ugh. Your USB job going begging would have been shipped quicker at half the price... In fact I could have walked to WA way quicker than Tube's job is taking to get here I reckon.

autoSteve commented 7 months ago

(Bollocks to walking, actually. At my age it's Business Class+ flying or nothing. I'd have had your USB jobby in a day trip, at slightly more expense, but avoiding frustration, which is... Priceless. 🤣)

autoSteve commented 7 months ago

Game on.

I ordered a slzb-01 PoE thing from dialedin, express.

Let's see who arrives first.

Holy merde! Reservoir, Vic. Just across the river. With express I'm tippping Friday vs. Monday best case for Tube's. Let's see if I'm right.