ztalbot2000 / homebridge-cmd4

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

[Feature Request] Homebridge v2.0 Breaking Updates #146

Closed mitch7391 closed 3 months ago

mitch7391 commented 4 months ago

Is your feature request related to a problem? Please describe: Hey @ztalbot2000 I am not sure if you are aware but the next version of Homebridge (v2.0) comes with breaking changes for a lot of Homebridge plug-ins and it has been put on the developers to get in line and update to match.

For Plug-In Developers

I have tested Cmd4 on the beta version and it will crash Homebridge.

Describe the solution you'd like: Please have a read of the link above and see what changes are required for Cmd4, this will ultimately affect my plug-in as well.

Describe alternatives you've considered: All users of Cmd4 will have to remain on Homebridge v1.8.4.

Additional context: image

mitch7391 commented 4 months ago

Tagging @uswong as well to keep in the loop.

ztalbot2000 commented 4 months ago

Hey Mitch,

Thanks for the heads up. Was your AdvAir impacted too? Would you happen to know if the changes required will be backward compatible? I know they were mucking about with homebridge-ui but not with homebridge. Thanks for the heads up. I'll have a peek by tomorrow evening sometime.

ttyl, John

mitch7391 commented 4 months ago

Hey John, I think AdvAir will be affected through Cmd4, but I would need to find some time to figure out if AdvAir is affected separately. My testing was as simple as update Homebridge and see which plug-ins threw errors causing a reboot cycle; it is hard to test AdvAir this same way when Cmd4 is already doing it :)

Anyway, glad I gave you a heads up as I know you have a lot of people rely on your plug-in.

mitch7391 commented 4 months ago

@ztalbot2000 I spent a bit more time trying to collect some logs for you and find some strange behaviour. It seems the plug-in will fail to initialise altogether, it then removes itself as a child bridge if it is one and then will refuse to load up again until a reboot of Homebridge is attempted. Trying to reboot the child bridge in the plug-ins tab does nothing (I think because it removes itself as a child bridge). This means it does not cause a Homebridge reboot seqeunce but does mean the plug-in fails.

[27/07/2024, 3:57:33 pm] Loaded plugin: homebridge-cmd4@7.1.0
[27/07/2024, 3:57:33 pm] ====================
[27/07/2024, 3:57:33 pm] ERROR INITIALIZING PLUGIN homebridge-cmd4:
[27/07/2024, 3:57:33 pm] TypeError: Cannot read properties of undefined (reading 'BOOL')
    at Object.init (/usr/local/lib/node_modules/homebridge-cmd4/lib/CMD4_CHAR_TYPE_ENUMS.js:61:44)
    at Plugin.default [as pluginInitializer] (/usr/local/lib/node_modules/homebridge-cmd4/index.js:41:44)
    at Plugin.initialize (/usr/local/lib/node_modules/homebridge/src/plugin.ts:244:17)
    at PluginManager.initializePlugin (/usr/local/lib/node_modules/homebridge/src/pluginManager.ts:173:20)
    at PluginManager.initializeInstalledPlugins (/usr/local/lib/node_modules/homebridge/src/pluginManager.ts:162:18)
    at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:161:5)
[27/07/2024, 3:57:33 pm] ====================
[27/07/2024, 3:57:33 pm] ---

Let me know if you need me to collect more logs, but will suggest with the little spare time on my hands currently that you could spin up a Homebridge instance, install Cmd4, then upgrade Homebridge to the beta and see what happens.

ztalbot2000 commented 4 months ago

Hi Mitch,

Thanks very much for this. It's an odd traceback. It complains about "Characteristic.Formats.BOOL". Characteristics is a passed in type from homebridge. They must have changed it, which is usually a big no no.

ttyl, John

On Sat, Jul 27, 2024 at 4:04 AM Mitch Williams @.***> wrote:

@ztalbot2000 https://github.com/ztalbot2000 I spent a bit more time trying to collect some logs for you and find some strange behaviour. It seems the plug-in will fail to initialise altogether, it then removes itself as a child bridge if it is one and then will refuse to load up again until a reboot of Homebridge is attempted. Trying to reboot the child bridge in the plug-ins tab does nothing (I think because it removes itself as a child bridge). This means it does not cause a Homebridge reboot seqeunce but does mean the plug-in fails.

[27/07/2024, 3:57:33 pm] Loaded plugin: @.*** [27/07/2024, 3:57:33 pm] ==================== [27/07/2024, 3:57:33 pm] ERROR INITIALIZING PLUGIN homebridge-cmd4: [27/07/2024, 3:57:33 pm] TypeError: Cannot read properties of undefined (reading 'BOOL') at Object.init (/usr/local/lib/node_modules/homebridge-cmd4/lib/CMD4_CHAR_TYPE_ENUMS.js:61:44) at Plugin.default [as pluginInitializer] (/usr/local/lib/node_modules/homebridge-cmd4/index.js:41:44) at Plugin.initialize (/usr/local/lib/node_modules/homebridge/src/plugin.ts:244:17) at PluginManager.initializePlugin (/usr/local/lib/node_modules/homebridge/src/pluginManager.ts:173:20) at PluginManager.initializeInstalledPlugins (/usr/local/lib/node_modules/homebridge/src/pluginManager.ts:162:18) at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:161:5) [27/07/2024, 3:57:33 pm] ==================== [27/07/2024, 3:57:33 pm] ---

Let me know if you need me to collect more logs, but will suggest with the little spare time on my hands currently that you could spin up a Homebridge instance, install Cmd4, then upgrade Homebridge to the beta and see what happens.

— Reply to this email directly, view it on GitHub https://github.com/ztalbot2000/homebridge-cmd4/issues/146#issuecomment-2254026906, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBCXYKCV4YORI52EDRI5LZONIAJAVCNFSM6AAAAABLN3PZCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJUGAZDMOJQGY . You are receiving this because you were mentioned.Message ID: @.***>

ztalbot2000 commented 4 months ago

Hey Mitch,

Good news, I was able to duplicate your traceback.

ttyl, John

On Sat, Jul 27, 2024 at 8:49 AM John Talbot @.***> wrote:

Hi Mitch,

Thanks very much for this. It's an odd traceback. It complains about "Characteristic.Formats.BOOL". Characteristics is a passed in type from homebridge. They must have changed it, which is usually a big no no.

ttyl, John

On Sat, Jul 27, 2024 at 4:04 AM Mitch Williams @.***> wrote:

@ztalbot2000 https://github.com/ztalbot2000 I spent a bit more time trying to collect some logs for you and find some strange behaviour. It seems the plug-in will fail to initialise altogether, it then removes itself as a child bridge if it is one and then will refuse to load up again until a reboot of Homebridge is attempted. Trying to reboot the child bridge in the plug-ins tab does nothing (I think because it removes itself as a child bridge). This means it does not cause a Homebridge reboot seqeunce but does mean the plug-in fails.

[27/07/2024, 3:57:33 pm] Loaded plugin: @.*** [27/07/2024, 3:57:33 pm] ==================== [27/07/2024, 3:57:33 pm] ERROR INITIALIZING PLUGIN homebridge-cmd4: [27/07/2024, 3:57:33 pm] TypeError: Cannot read properties of undefined (reading 'BOOL') at Object.init (/usr/local/lib/node_modules/homebridge-cmd4/lib/CMD4_CHAR_TYPE_ENUMS.js:61:44) at Plugin.default [as pluginInitializer] (/usr/local/lib/node_modules/homebridge-cmd4/index.js:41:44) at Plugin.initialize (/usr/local/lib/node_modules/homebridge/src/plugin.ts:244:17) at PluginManager.initializePlugin (/usr/local/lib/node_modules/homebridge/src/pluginManager.ts:173:20) at PluginManager.initializeInstalledPlugins (/usr/local/lib/node_modules/homebridge/src/pluginManager.ts:162:18) at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:161:5) [27/07/2024, 3:57:33 pm] ==================== [27/07/2024, 3:57:33 pm] ---

Let me know if you need me to collect more logs, but will suggest with the little spare time on my hands currently that you could spin up a Homebridge instance, install Cmd4, then upgrade Homebridge to the beta and see what happens.

— Reply to this email directly, view it on GitHub https://github.com/ztalbot2000/homebridge-cmd4/issues/146#issuecomment-2254026906, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBCXYKCV4YORI52EDRI5LZONIAJAVCNFSM6AAAAABLN3PZCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJUGAZDMOJQGY . You are receiving this because you were mentioned.Message ID: @.***>

ztalbot2000 commented 4 months ago

Hey Mitch,

Getting closer. Cmd4 has the latest stuff under b_Ver8. What I found so far is that the Characteristic type provided by homebridge no longer has the Formats,Perms & Units sub types. These types must be taken directly from api.hap. The branch so far fixes these and is backward compatible, but there is a further issue with valid values. I'll check this later as that's it for now.

ttyl, John

On Sat, Jul 27, 2024 at 9:10 AM John Talbot @.***> wrote:

Hey Mitch,

Good news, I was able to duplicate your traceback.

ttyl, John

On Sat, Jul 27, 2024 at 8:49 AM John Talbot @.***> wrote:

Hi Mitch,

Thanks very much for this. It's an odd traceback. It complains about "Characteristic.Formats.BOOL". Characteristics is a passed in type from homebridge. They must have changed it, which is usually a big no no.

ttyl, John

On Sat, Jul 27, 2024 at 4:04 AM Mitch Williams @.***> wrote:

@ztalbot2000 https://github.com/ztalbot2000 I spent a bit more time trying to collect some logs for you and find some strange behaviour. It seems the plug-in will fail to initialise altogether, it then removes itself as a child bridge if it is one and then will refuse to load up again until a reboot of Homebridge is attempted. Trying to reboot the child bridge in the plug-ins tab does nothing (I think because it removes itself as a child bridge). This means it does not cause a Homebridge reboot seqeunce but does mean the plug-in fails.

[27/07/2024, 3:57:33 pm] Loaded plugin: @.*** [27/07/2024, 3:57:33 pm] ==================== [27/07/2024, 3:57:33 pm] ERROR INITIALIZING PLUGIN homebridge-cmd4: [27/07/2024, 3:57:33 pm] TypeError: Cannot read properties of undefined (reading 'BOOL') at Object.init (/usr/local/lib/node_modules/homebridge-cmd4/lib/CMD4_CHAR_TYPE_ENUMS.js:61:44) at Plugin.default [as pluginInitializer] (/usr/local/lib/node_modules/homebridge-cmd4/index.js:41:44) at Plugin.initialize (/usr/local/lib/node_modules/homebridge/src/plugin.ts:244:17) at PluginManager.initializePlugin (/usr/local/lib/node_modules/homebridge/src/pluginManager.ts:173:20) at PluginManager.initializeInstalledPlugins (/usr/local/lib/node_modules/homebridge/src/pluginManager.ts:162:18) at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:161:5) [27/07/2024, 3:57:33 pm] ==================== [27/07/2024, 3:57:33 pm] ---

Let me know if you need me to collect more logs, but will suggest with the little spare time on my hands currently that you could spin up a Homebridge instance, install Cmd4, then upgrade Homebridge to the beta and see what happens.

— Reply to this email directly, view it on GitHub https://github.com/ztalbot2000/homebridge-cmd4/issues/146#issuecomment-2254026906, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBCXYKCV4YORI52EDRI5LZONIAJAVCNFSM6AAAAABLN3PZCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJUGAZDMOJQGY . You are receiving this because you were mentioned.Message ID: @.***>

ztalbot2000 commented 4 months ago

Hi Mitch,

Sio TargetAirQuality and TargetSlatState are now deprecated, this gave a few init problems that I've corrected. the branch b_Ver8 should work though I want to check how docs are created and the example config.json uses them.

night, John

On Sat, Jul 27, 2024 at 12:05 PM John Talbot @.***> wrote:

Hey Mitch,

Getting closer. Cmd4 has the latest stuff under b_Ver8. What I found so far is that the Characteristic type provided by homebridge no longer has the Formats,Perms & Units sub types. These types must be taken directly from api.hap. The branch so far fixes these and is backward compatible, but there is a further issue with valid values. I'll check this later as that's it for now.

ttyl, John

On Sat, Jul 27, 2024 at 9:10 AM John Talbot @.***> wrote:

Hey Mitch,

Good news, I was able to duplicate your traceback.

ttyl, John

On Sat, Jul 27, 2024 at 8:49 AM John Talbot @.***> wrote:

Hi Mitch,

Thanks very much for this. It's an odd traceback. It complains about "Characteristic.Formats.BOOL". Characteristics is a passed in type from homebridge. They must have changed it, which is usually a big no no.

ttyl, John

On Sat, Jul 27, 2024 at 4:04 AM Mitch Williams @.***> wrote:

@ztalbot2000 https://github.com/ztalbot2000 I spent a bit more time trying to collect some logs for you and find some strange behaviour. It seems the plug-in will fail to initialise altogether, it then removes itself as a child bridge if it is one and then will refuse to load up again until a reboot of Homebridge is attempted. Trying to reboot the child bridge in the plug-ins tab does nothing (I think because it removes itself as a child bridge). This means it does not cause a Homebridge reboot seqeunce but does mean the plug-in fails.

[27/07/2024, 3:57:33 pm] Loaded plugin: @.*** [27/07/2024, 3:57:33 pm] ==================== [27/07/2024, 3:57:33 pm] ERROR INITIALIZING PLUGIN homebridge-cmd4: [27/07/2024, 3:57:33 pm] TypeError: Cannot read properties of undefined (reading 'BOOL') at Object.init (/usr/local/lib/node_modules/homebridge-cmd4/lib/CMD4_CHAR_TYPE_ENUMS.js:61:44) at Plugin.default [as pluginInitializer] (/usr/local/lib/node_modules/homebridge-cmd4/index.js:41:44) at Plugin.initialize (/usr/local/lib/node_modules/homebridge/src/plugin.ts:244:17) at PluginManager.initializePlugin (/usr/local/lib/node_modules/homebridge/src/pluginManager.ts:173:20) at PluginManager.initializeInstalledPlugins (/usr/local/lib/node_modules/homebridge/src/pluginManager.ts:162:18) at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:161:5) [27/07/2024, 3:57:33 pm] ==================== [27/07/2024, 3:57:33 pm] ---

Let me know if you need me to collect more logs, but will suggest with the little spare time on my hands currently that you could spin up a Homebridge instance, install Cmd4, then upgrade Homebridge to the beta and see what happens.

— Reply to this email directly, view it on GitHub https://github.com/ztalbot2000/homebridge-cmd4/issues/146#issuecomment-2254026906, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBCXYKCV4YORI52EDRI5LZONIAJAVCNFSM6AAAAABLN3PZCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJUGAZDMOJQGY . You are receiving this because you were mentioned.Message ID: @.***>

ztalbot2000 commented 4 months ago

Hey Mitch,

I just published to npm v8.00-beta1. It should be backward compatible to your plugin.

Ttyl, John

On Sat, Jul 27, 2024 at 11:21 PM John Talbot @.***> wrote:

Hi Mitch,

Sio TargetAirQuality and TargetSlatState are now deprecated, this gave a few init problems that I've corrected. the branch b_Ver8 should work though I want to check how docs are created and the example config.json uses them.

night, John

On Sat, Jul 27, 2024 at 12:05 PM John Talbot @.***> wrote:

Hey Mitch,

Getting closer. Cmd4 has the latest stuff under b_Ver8. What I found so far is that the Characteristic type provided by homebridge no longer has the Formats,Perms & Units sub types. These types must be taken directly from api.hap. The branch so far fixes these and is backward compatible, but there is a further issue with valid values. I'll check this later as that's it for now.

ttyl, John

On Sat, Jul 27, 2024 at 9:10 AM John Talbot @.***> wrote:

Hey Mitch,

Good news, I was able to duplicate your traceback.

ttyl, John

On Sat, Jul 27, 2024 at 8:49 AM John Talbot @.***> wrote:

Hi Mitch,

Thanks very much for this. It's an odd traceback. It complains about "Characteristic.Formats.BOOL". Characteristics is a passed in type from homebridge. They must have changed it, which is usually a big no no.

ttyl, John

On Sat, Jul 27, 2024 at 4:04 AM Mitch Williams < @.***> wrote:

@ztalbot2000 https://github.com/ztalbot2000 I spent a bit more time trying to collect some logs for you and find some strange behaviour. It seems the plug-in will fail to initialise altogether, it then removes itself as a child bridge if it is one and then will refuse to load up again until a reboot of Homebridge is attempted. Trying to reboot the child bridge in the plug-ins tab does nothing (I think because it removes itself as a child bridge). This means it does not cause a Homebridge reboot seqeunce but does mean the plug-in fails.

[27/07/2024, 3:57:33 pm] Loaded plugin: @.*** [27/07/2024, 3:57:33 pm] ==================== [27/07/2024, 3:57:33 pm] ERROR INITIALIZING PLUGIN homebridge-cmd4: [27/07/2024, 3:57:33 pm] TypeError: Cannot read properties of undefined (reading 'BOOL') at Object.init (/usr/local/lib/node_modules/homebridge-cmd4/lib/CMD4_CHAR_TYPE_ENUMS.js:61:44) at Plugin.default [as pluginInitializer] (/usr/local/lib/node_modules/homebridge-cmd4/index.js:41:44) at Plugin.initialize (/usr/local/lib/node_modules/homebridge/src/plugin.ts:244:17) at PluginManager.initializePlugin (/usr/local/lib/node_modules/homebridge/src/pluginManager.ts:173:20) at PluginManager.initializeInstalledPlugins (/usr/local/lib/node_modules/homebridge/src/pluginManager.ts:162:18) at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:161:5) [27/07/2024, 3:57:33 pm] ==================== [27/07/2024, 3:57:33 pm] ---

Let me know if you need me to collect more logs, but will suggest with the little spare time on my hands currently that you could spin up a Homebridge instance, install Cmd4, then upgrade Homebridge to the beta and see what happens.

— Reply to this email directly, view it on GitHub https://github.com/ztalbot2000/homebridge-cmd4/issues/146#issuecomment-2254026906, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBCXYKCV4YORI52EDRI5LZONIAJAVCNFSM6AAAAABLN3PZCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJUGAZDMOJQGY . You are receiving this because you were mentioned.Message ID: @.***>

ztalbot2000 commented 4 months ago

Hey Mitch,

I think I spoke to soon. Found an issue

On Sun, Jul 28, 2024 at 8:08 AM John Talbot @.***> wrote:

Hey Mitch,

I just published to npm v8.00-beta1. It should be backward compatible to your plugin.

Ttyl, John

On Sat, Jul 27, 2024 at 11:21 PM John Talbot @.***> wrote:

Hi Mitch,

Sio TargetAirQuality and TargetSlatState are now deprecated, this gave a few init problems that I've corrected. the branch b_Ver8 should work though I want to check how docs are created and the example config.json uses them.

night, John

On Sat, Jul 27, 2024 at 12:05 PM John Talbot @.***> wrote:

Hey Mitch,

Getting closer. Cmd4 has the latest stuff under b_Ver8. What I found so far is that the Characteristic type provided by homebridge no longer has the Formats,Perms & Units sub types. These types must be taken directly from api.hap. The branch so far fixes these and is backward compatible, but there is a further issue with valid values. I'll check this later as that's it for now.

ttyl, John

On Sat, Jul 27, 2024 at 9:10 AM John Talbot @.***> wrote:

Hey Mitch,

Good news, I was able to duplicate your traceback.

ttyl, John

On Sat, Jul 27, 2024 at 8:49 AM John Talbot @.***> wrote:

Hi Mitch,

Thanks very much for this. It's an odd traceback. It complains about "Characteristic.Formats.BOOL". Characteristics is a passed in type from homebridge. They must have changed it, which is usually a big no no.

ttyl, John

On Sat, Jul 27, 2024 at 4:04 AM Mitch Williams < @.***> wrote:

@ztalbot2000 https://github.com/ztalbot2000 I spent a bit more time trying to collect some logs for you and find some strange behaviour. It seems the plug-in will fail to initialise altogether, it then removes itself as a child bridge if it is one and then will refuse to load up again until a reboot of Homebridge is attempted. Trying to reboot the child bridge in the plug-ins tab does nothing (I think because it removes itself as a child bridge). This means it does not cause a Homebridge reboot seqeunce but does mean the plug-in fails.

[27/07/2024, 3:57:33 pm] Loaded plugin: @.*** [27/07/2024, 3:57:33 pm] ==================== [27/07/2024, 3:57:33 pm] ERROR INITIALIZING PLUGIN homebridge-cmd4: [27/07/2024, 3:57:33 pm] TypeError: Cannot read properties of undefined (reading 'BOOL') at Object.init (/usr/local/lib/node_modules/homebridge-cmd4/lib/CMD4_CHAR_TYPE_ENUMS.js:61:44) at Plugin.default [as pluginInitializer] (/usr/local/lib/node_modules/homebridge-cmd4/index.js:41:44) at Plugin.initialize (/usr/local/lib/node_modules/homebridge/src/plugin.ts:244:17) at PluginManager.initializePlugin (/usr/local/lib/node_modules/homebridge/src/pluginManager.ts:173:20) at PluginManager.initializeInstalledPlugins (/usr/local/lib/node_modules/homebridge/src/pluginManager.ts:162:18) at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:161:5) [27/07/2024, 3:57:33 pm] ==================== [27/07/2024, 3:57:33 pm] ---

Let me know if you need me to collect more logs, but will suggest with the little spare time on my hands currently that you could spin up a Homebridge instance, install Cmd4, then upgrade Homebridge to the beta and see what happens.

— Reply to this email directly, view it on GitHub https://github.com/ztalbot2000/homebridge-cmd4/issues/146#issuecomment-2254026906, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBCXYKCV4YORI52EDRI5LZONIAJAVCNFSM6AAAAABLN3PZCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJUGAZDMOJQGY . You are receiving this because you were mentioned.Message ID: @.***>

ztalbot2000 commented 4 months ago

Hi Mitch.

P[ublished beta.2. IT runs under homebridge v2, but a lot of tests fail for bridged devices and also some of my tests check the output of homebridge and they added messages that I do not account for. You should give this a go though.

ttyl, John

On Sun, Jul 28, 2024 at 3:58 PM John Talbot @.***> wrote:

Hey Mitch,

I think I spoke to soon. Found an issue

On Sun, Jul 28, 2024 at 8:08 AM John Talbot @.***> wrote:

Hey Mitch,

I just published to npm v8.00-beta1. It should be backward compatible to your plugin.

Ttyl, John

On Sat, Jul 27, 2024 at 11:21 PM John Talbot @.***> wrote:

Hi Mitch,

Sio TargetAirQuality and TargetSlatState are now deprecated, this gave a few init problems that I've corrected. the branch b_Ver8 should work though I want to check how docs are created and the example config.json uses them.

night, John

On Sat, Jul 27, 2024 at 12:05 PM John Talbot @.***> wrote:

Hey Mitch,

Getting closer. Cmd4 has the latest stuff under b_Ver8. What I found so far is that the Characteristic type provided by homebridge no longer has the Formats,Perms & Units sub types. These types must be taken directly from api.hap. The branch so far fixes these and is backward compatible, but there is a further issue with valid values. I'll check this later as that's it for now.

ttyl, John

On Sat, Jul 27, 2024 at 9:10 AM John Talbot @.***> wrote:

Hey Mitch,

Good news, I was able to duplicate your traceback.

ttyl, John

On Sat, Jul 27, 2024 at 8:49 AM John Talbot @.***> wrote:

Hi Mitch,

Thanks very much for this. It's an odd traceback. It complains about "Characteristic.Formats.BOOL". Characteristics is a passed in type from homebridge. They must have changed it, which is usually a big no no.

ttyl, John

On Sat, Jul 27, 2024 at 4:04 AM Mitch Williams < @.***> wrote:

@ztalbot2000 https://github.com/ztalbot2000 I spent a bit more time trying to collect some logs for you and find some strange behaviour. It seems the plug-in will fail to initialise altogether, it then removes itself as a child bridge if it is one and then will refuse to load up again until a reboot of Homebridge is attempted. Trying to reboot the child bridge in the plug-ins tab does nothing (I think because it removes itself as a child bridge). This means it does not cause a Homebridge reboot seqeunce but does mean the plug-in fails.

[27/07/2024, 3:57:33 pm] Loaded plugin: @.*** [27/07/2024, 3:57:33 pm] ==================== [27/07/2024, 3:57:33 pm] ERROR INITIALIZING PLUGIN homebridge-cmd4: [27/07/2024, 3:57:33 pm] TypeError: Cannot read properties of undefined (reading 'BOOL') at Object.init (/usr/local/lib/node_modules/homebridge-cmd4/lib/CMD4_CHAR_TYPE_ENUMS.js:61:44) at Plugin.default [as pluginInitializer] (/usr/local/lib/node_modules/homebridge-cmd4/index.js:41:44) at Plugin.initialize (/usr/local/lib/node_modules/homebridge/src/plugin.ts:244:17) at PluginManager.initializePlugin (/usr/local/lib/node_modules/homebridge/src/pluginManager.ts:173:20) at PluginManager.initializeInstalledPlugins (/usr/local/lib/node_modules/homebridge/src/pluginManager.ts:162:18) at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:161:5) [27/07/2024, 3:57:33 pm] ==================== [27/07/2024, 3:57:33 pm] ---

Let me know if you need me to collect more logs, but will suggest with the little spare time on my hands currently that you could spin up a Homebridge instance, install Cmd4, then upgrade Homebridge to the beta and see what happens.

— Reply to this email directly, view it on GitHub https://github.com/ztalbot2000/homebridge-cmd4/issues/146#issuecomment-2254026906, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBCXYKCV4YORI52EDRI5LZONIAJAVCNFSM6AAAAABLN3PZCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJUGAZDMOJQGY . You are receiving this because you were mentioned.Message ID: @.***>

ztalbot2000 commented 4 months ago

Hey Mitch,

Just published @.*** There is something seriously wrong with homebridge v2. First there are a number of device types and characteristics that are now deprecated. These are mainly Bridge type Accessories and their characteristics. I've taken care of those by marking them deprecated in my lib files. The BIG problem I have is that the library files during unit testing are having memory problems. For example if I print out perms of index 1, instead of getting "pr", "ev" I get null, "pr" I'll dig more but I'd like you to give this beta a try.

ttyl, John

On Sun, Jul 28, 2024 at 5:40 PM John Talbot @.***> wrote:

Hi Mitch.

P[ublished beta.2. IT runs under homebridge v2, but a lot of tests fail for bridged devices and also some of my tests check the output of homebridge and they added messages that I do not account for. You should give this a go though.

ttyl, John

On Sun, Jul 28, 2024 at 3:58 PM John Talbot @.***> wrote:

Hey Mitch,

I think I spoke to soon. Found an issue

On Sun, Jul 28, 2024 at 8:08 AM John Talbot @.***> wrote:

Hey Mitch,

I just published to npm v8.00-beta1. It should be backward compatible to your plugin.

Ttyl, John

On Sat, Jul 27, 2024 at 11:21 PM John Talbot @.***> wrote:

Hi Mitch,

Sio TargetAirQuality and TargetSlatState are now deprecated, this gave a few init problems that I've corrected. the branch b_Ver8 should work though I want to check how docs are created and the example config.json uses them.

night, John

On Sat, Jul 27, 2024 at 12:05 PM John Talbot @.***> wrote:

Hey Mitch,

Getting closer. Cmd4 has the latest stuff under b_Ver8. What I found so far is that the Characteristic type provided by homebridge no longer has the Formats,Perms & Units sub types. These types must be taken directly from api.hap. The branch so far fixes these and is backward compatible, but there is a further issue with valid values. I'll check this later as that's it for now.

ttyl, John

On Sat, Jul 27, 2024 at 9:10 AM John Talbot @.***> wrote:

Hey Mitch,

Good news, I was able to duplicate your traceback.

ttyl, John

On Sat, Jul 27, 2024 at 8:49 AM John Talbot @.***> wrote:

Hi Mitch,

Thanks very much for this. It's an odd traceback. It complains about "Characteristic.Formats.BOOL". Characteristics is a passed in type from homebridge. They must have changed it, which is usually a big no no.

ttyl, John

On Sat, Jul 27, 2024 at 4:04 AM Mitch Williams < @.***> wrote:

@ztalbot2000 https://github.com/ztalbot2000 I spent a bit more time trying to collect some logs for you and find some strange behaviour. It seems the plug-in will fail to initialise altogether, it then removes itself as a child bridge if it is one and then will refuse to load up again until a reboot of Homebridge is attempted. Trying to reboot the child bridge in the plug-ins tab does nothing (I think because it removes itself as a child bridge). This means it does not cause a Homebridge reboot seqeunce but does mean the plug-in fails.

[27/07/2024, 3:57:33 pm] Loaded plugin: @.*** [27/07/2024, 3:57:33 pm] ==================== [27/07/2024, 3:57:33 pm] ERROR INITIALIZING PLUGIN homebridge-cmd4: [27/07/2024, 3:57:33 pm] TypeError: Cannot read properties of undefined (reading 'BOOL') at Object.init (/usr/local/lib/node_modules/homebridge-cmd4/lib/CMD4_CHAR_TYPE_ENUMS.js:61:44) at Plugin.default [as pluginInitializer] (/usr/local/lib/node_modules/homebridge-cmd4/index.js:41:44) at Plugin.initialize (/usr/local/lib/node_modules/homebridge/src/plugin.ts:244:17) at PluginManager.initializePlugin (/usr/local/lib/node_modules/homebridge/src/pluginManager.ts:173:20) at PluginManager.initializeInstalledPlugins (/usr/local/lib/node_modules/homebridge/src/pluginManager.ts:162:18) at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:161:5) [27/07/2024, 3:57:33 pm] ==================== [27/07/2024, 3:57:33 pm] ---

Let me know if you need me to collect more logs, but will suggest with the little spare time on my hands currently that you could spin up a Homebridge instance, install Cmd4, then upgrade Homebridge to the beta and see what happens.

— Reply to this email directly, view it on GitHub https://github.com/ztalbot2000/homebridge-cmd4/issues/146#issuecomment-2254026906, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBCXYKCV4YORI52EDRI5LZONIAJAVCNFSM6AAAAABLN3PZCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJUGAZDMOJQGY . You are receiving this because you were mentioned.Message ID: @.***>

mitch7391 commented 4 months ago

Hey John, I can see you have been busy :) just installed the beta on Homebridge v1.8.4 to start with and have noticed it loads all my accessories but then removes them all; which is pretty annoying as I have to set them all up across Homekit again... Here are the logs just incase.

[29/07/2024, 1:14:46 pm] [Homebridge UI] Running Command: sudo -E -n npm install -g homebridge-cmd4@8.0.0-beta.3
[29/07/2024, 1:16:41 pm] [Cmd4] Restarting child bridge...
[29/07/2024, 1:16:41 pm] Got SIGTERM, shutting down child bridge process...
[29/07/2024, 1:16:48 pm] [Cmd4] Child bridge process ended
[29/07/2024, 1:16:48 pm] [Cmd4] Process Ended. Code: 143, Signal: null
[29/07/2024, 1:16:55 pm] [Cmd4] Restarting Process...
[29/07/2024, 1:16:56 pm] [Cmd4] Launched child bridge with PID 17786
[29/07/2024, 1:16:56 pm] Registering accessory 'homebridge-cmd4.Cmd4'
[29/07/2024, 1:16:57 pm] Registering platform 'homebridge-cmd4.Cmd4'
[29/07/2024, 1:16:57 pm] [Cmd4] Loaded homebridge-cmd4 v8.0.0-beta.3 child bridge successfully
[29/07/2024, 1:16:57 pm] Loaded 16 cached accessories from cachedAccessories.0EF085EB9153.
[29/07/2024, 1:16:57 pm] [Cmd4] Cmd4Platform didFinishLaunching
[29/07/2024, 1:16:57 pm] [Cmd4] Restoring existing accessory from cache: Aircon
[29/07/2024, 1:17:21 pm] [Cmd4] Creating linked accessories for: Aircon
[29/07/2024, 1:17:21 pm] [Cmd4] Restoring existing accessory from cache: Aircon Fan
[29/07/2024, 1:17:21 pm] [Cmd4] Restoring existing accessory from cache: Aircon Timer
[29/07/2024, 1:17:21 pm] [Cmd4] Restoring existing accessory from cache: Living Room Zone
[29/07/2024, 1:17:21 pm] [Cmd4] Restoring existing accessory from cache: Theater Zone
[29/07/2024, 1:17:21 pm] [Cmd4] Restoring existing accessory from cache: Bedroom Zone
[29/07/2024, 1:17:21 pm] [Cmd4] Restoring existing accessory from cache: Craft Room Zone
[29/07/2024, 1:17:21 pm] [Cmd4] Restoring existing accessory from cache: Guest Room Zone
[29/07/2024, 1:17:21 pm] [Cmd4] Restoring existing accessory from cache: Nursery Zone
[29/07/2024, 1:17:21 pm] [Cmd4] Restoring existing accessory from cache: Living Room Temperature
[29/07/2024, 1:17:21 pm] [Cmd4] Restoring existing accessory from cache: Theater Temperature
[29/07/2024, 1:17:21 pm] [Cmd4] Restoring existing accessory from cache: Bedroom Temperature
[29/07/2024, 1:17:21 pm] [Cmd4] Restoring existing accessory from cache: Craft Room Temperature
[29/07/2024, 1:17:21 pm] [Cmd4] Restoring existing accessory from cache: Guest Room Temperature
[29/07/2024, 1:17:21 pm] [Cmd4] Restoring existing accessory from cache: Nursery Temperature
[29/07/2024, 1:17:21 pm] [Cmd4] Restoring existing accessory from cache: PS5
[29/07/2024, 1:17:21 pm] [Cmd4] Adding new platformAccessory: Hisense
[29/07/2024, 1:17:21 pm] [Cmd4] Configuring platformAccessory: Hisense
[29/07/2024, 1:17:21 pm] [Cmd4] Creating accessories for: Hisense
[29/07/2024, 1:17:21 pm] [Cmd4] Creating linked accessories for: Hisense
[29/07/2024, 1:17:21 pm] [Cmd4] Cmd4 is running in Demo Mode for TV
[29/07/2024, 1:17:21 pm] [Cmd4] Cmd4 is running in Demo Mode for HDMI1
[29/07/2024, 1:17:21 pm] [Cmd4] Cmd4 is running in Demo Mode for HDMI2
[29/07/2024, 1:17:21 pm] [Cmd4] Cmd4 is running in Demo Mode for HDMI3
[29/07/2024, 1:17:21 pm] [Cmd4] Cmd4 is running in Demo Mode for HDMI4
[29/07/2024, 1:17:21 pm] [Cmd4] Cmd4 is running in Demo Mode for AV
[29/07/2024, 1:17:21 pm] [Cmd4] Accessory Aircon will be removed.
[29/07/2024, 1:17:21 pm] [Cmd4] Accessory Aircon Fan will be removed.
[29/07/2024, 1:17:40 pm] [Cmd4] Accessory Aircon Timer will be removed.[29/07/2024, 1:18:35 pm] [Cmd4] Accessory Living Room Zone will be removed.
[29/07/2024, 1:18:36 pm] [Cmd4] Accessory Theater Zone will be removed.
[29/07/2024, 1:18:36 pm] [Cmd4] Accessory Bedroom Zone will be removed.
[29/07/2024, 1:18:36 pm] [Cmd4] Accessory Craft Room Zone will be removed.
[29/07/2024, 1:18:36 pm] [Cmd4] Accessory Guest Room Zone will be removed.
[29/07/2024, 1:18:36 pm] [Cmd4] Accessory Nursery Zone will be removed.
[29/07/2024, 1:18:36 pm] [Cmd4] Accessory Living Room Temperature will be removed.
[29/07/2024, 1:18:36 pm] [Cmd4] Accessory Theater Temperature will be removed.
[29/07/2024, 1:18:36 pm] [Cmd4] Accessory Bedroom Temperature will be removed.
[29/07/2024, 1:18:36 pm] [Cmd4] Accessory Craft Room Temperature will be removed.
[29/07/2024, 1:18:36 pm] [Cmd4] Accessory Guest Room Temperature will be removed.
[29/07/2024, 1:18:36 pm] [Cmd4] Accessory Nursery Temperature will be removed.
[29/07/2024, 1:18:36 pm] [Cmd4] Accessory PS5 will be removed.
[29/07/2024, 1:18:36 pm] Homebridge v1.8.4 (HAP v0.12.2) (Cmd4) is running on port 46526.
[29/07/2024, 1:18:36 pm] 

NOTICE TO USERS AND PLUGIN DEVELOPERS
> Homebridge 2.0 is on the way and brings some breaking changes to existing plugins.
> Please visit the following link to learn more about the changes and how to prepare:
> https://github.com/homebridge/homebridge/wiki/Updating-To-Homebridge-v2.0

[29/07/2024, 1:18:36 pm] Parent process did not respond to port allocation request within 5 seconds - assigning random port.
[29/07/2024, 1:18:36 pm] Hisense E7B5 is running on port XXXXX.
[29/07/2024, 1:18:36 pm] Please add [Hisense E7B5] manually in Home app. Setup Code: XXX-XX-XXX
[29/07/2024, 1:19:16 pm] [Cmd4] *** Starting Polling
[29/07/2024, 1:21:19 pm] [Cmd4] *** All characteristics are now being polled

I will try to get and test this on Homebridge v2 soon, just need to make sure I am prepared as it destroys my whole home and have to do a restore afterwards which takes a bit of time.

mitch7391 commented 4 months ago

Hey John, looks like Cmd4 v8.0.0-beta.3 is working for me on Homebridge v2 and no more crashing:


[29/07/2024, 2:05:49 pm] [Cmd4] Restarting child bridge...
[29/07/2024, 2:05:49 pm] Got SIGTERM, shutting down child bridge process...
[29/07/2024, 2:05:54 pm] [Cmd4] Child bridge process ended
[29/07/2024, 2:05:54 pm] [Cmd4] Process Ended. Code: 143, Signal: null
[29/07/2024, 2:06:01 pm] [Cmd4] Restarting Process...
[29/07/2024, 2:06:02 pm] [Cmd4] Launched child bridge with PID 20796
[29/07/2024, 2:06:02 pm] Registering accessory 'homebridge-cmd4.Cmd4'
[29/07/2024, 2:06:02 pm] Registering platform 'homebridge-cmd4.Cmd4'
[29/07/2024, 2:06:02 pm] [Cmd4] Loaded homebridge-cmd4 v8.0.0-beta.3 child bridge successfully
[29/07/2024, 2:06:02 pm] Loaded 16 cached accessories from cachedAccessories.0EF085EB9153.
[29/07/2024, 2:06:02 pm] [Cmd4] Cmd4Platform didFinishLaunching
[29/07/2024, 2:06:02 pm] [Cmd4] Restoring existing accessory from cache: Aircon
[29/07/2024, 2:06:05 pm] [Cmd4] Creating linked accessories for: Aircon
[29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Aircon Fan
[29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Aircon Timer
[29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Living Room Zone
[29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Theater Zone
[29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Bedroom Zone
[29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Craft Room Zone
[29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Guest Room Zone
[29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Nursery Zone
[29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Living Room Temperature
[29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Theater Temperature
[29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Bedroom Temperature
[29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Craft Room Temperature
[29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Guest Room Temperature
[29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Nursery Temperature
[29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: PS5
[29/07/2024, 2:06:05 pm] [Cmd4] Adding new platformAccessory: Hisense
[29/07/2024, 2:06:05 pm] [Cmd4] Configuring platformAccessory: Hisense
[29/07/2024, 2:06:05 pm] [Cmd4] Creating accessories for: Hisense
[29/07/2024, 2:06:05 pm] [Cmd4] Creating linked accessories for: Hisense
[29/07/2024, 2:06:05 pm] [Cmd4] Cmd4 is running in Demo Mode for TV
[29/07/2024, 2:06:05 pm] [Cmd4] Cmd4 is running in Demo Mode for HDMI1
[29/07/2024, 2:06:05 pm] [Cmd4] Cmd4 is running in Demo Mode for HDMI2
[29/07/2024, 2:06:05 pm] [Cmd4] Cmd4 is running in Demo Mode for HDMI3
[29/07/2024, 2:06:05 pm] [Cmd4] Cmd4 is running in Demo Mode for HDMI4
[29/07/2024, 2:06:05 pm] [Cmd4] Cmd4 is running in Demo Mode for AV
HAP-NodeJS WARNING: The accessory 'My_TelevisionSpeaker' has an invalid 'Name' characteristic ('My_TelevisionSpeaker'). Please use only alphanumeric, space, and apostrophe characters. Ensure it starts and ends with an alphabetic or numeric character, and avoid emojis. This may prevent the accessory from being added in the Home App or cause unresponsiveness.
[29/07/2024, 2:06:05 pm] [Cmd4] Accessory Aircon will be removed.
[29/07/2024, 2:06:05 pm] [Cmd4] Accessory Aircon Fan will be removed.
[29/07/2024, 2:06:05 pm] [Cmd4] Accessory Aircon Timer will be removed.
[29/07/2024, 2:06:05 pm] [Cmd4] Accessory Living Room Zone will be removed.
[29/07/2024, 2:06:05 pm] [Cmd4] Accessory Theater Zone will be removed.
[29/07/2024, 2:06:05 pm] [Cmd4] Accessory Bedroom Zone will be removed.
[29/07/2024, 2:06:05 pm] [Cmd4] Accessory Craft Room Zone will be removed.
[29/07/2024, 2:06:05 pm] [Cmd4] Accessory Guest Room Zone will be removed.
[29/07/2024, 2:06:05 pm] [Cmd4] Accessory Nursery Zone will be removed.
[29/07/2024, 2:06:05 pm] [Cmd4] Accessory Living Room Temperature will be removed.
[29/07/2024, 2:06:05 pm] [Cmd4] Accessory Theater Temperature will be removed.
[29/07/2024, 2:06:05 pm] [Cmd4] Accessory Bedroom Temperature will be removed.
[29/07/2024, 2:06:06 pm] [Cmd4] Accessory Craft Room Temperature will be removed.
[29/07/2024, 2:06:06 pm] [Cmd4] Accessory Guest Room Temperature will be removed.
[29/07/2024, 2:06:06 pm] [Cmd4] Accessory Nursery Temperature will be removed.
[29/07/2024, 2:06:06 pm] [Cmd4] Accessory PS5 will be removed.
[29/07/2024, 2:06:06 pm] Homebridge v1.8.5-beta.4 (HAP v0.12.3-beta.26) (Cmd4) is running on port 46526.
[29/07/2024, 2:06:06 pm] 

NOTICE TO USERS AND PLUGIN DEVELOPERS
> Homebridge 2.0 is on the way and brings some breaking changes to existing plugins.
> Please visit the following link to learn more about the changes and how to prepare:
> https://github.com/homebridge/homebridge/wiki/Updating-To-Homebridge-v2.0

[29/07/2024, 2:06:06 pm] Hisense E7B5 is running on port XXXXX.
[29/07/2024, 2:06:06 pm] Please add [Hisense E7B5] manually in Home app. Setup Code: XXX-XX-XXX
[29/07/2024, 2:06:46 pm] [Cmd4] *** Starting Polling
[29/07/2024, 2:08:49 pm] [Cmd4] *** All characteristics are now being polled

The only thing it complains about is the following:

HAP-NodeJS WARNING: The accessory 'My_TelevisionSpeaker' has an invalid 'Name' characteristic ('My_TelevisionSpeaker'). Please use only alphanumeric, space, and apostrophe characters. Ensure it starts and ends with an alphabetic or numeric character, and avoid emojis. This may prevent the accessory from being added in the Home App or cause unresponsiveness.

Is there an easy way for you to set up all services/charateristics and see which ones complain? As it stands this works perfectly for my AdvAir plug-in, but others might still have warnings like I do for my Hisense TV setup through your plug-in.

ztalbot2000 commented 4 months ago

Hi Mitch,

Beta 3 works, but beta 4 doesn't. Did I understand you correctly? If that's correct that's very annoying. I'll check it out.

Ttyl, John

On Mon, Jul 29, 2024 at 2:11 AM Mitch Williams @.***> wrote:

Hey John, looks like Cmd4 v8.0.0-beta.3 is working for me on Homebridge v2 and no more crashing:

[29/07/2024, 2:05:49 pm] [Cmd4] Restarting child bridge... [29/07/2024, 2:05:49 pm] Got SIGTERM, shutting down child bridge process... [29/07/2024, 2:05:54 pm] [Cmd4] Child bridge process ended [29/07/2024, 2:05:54 pm] [Cmd4] Process Ended. Code: 143, Signal: null [29/07/2024, 2:06:01 pm] [Cmd4] Restarting Process... [29/07/2024, 2:06:02 pm] [Cmd4] Launched child bridge with PID 20796 [29/07/2024, 2:06:02 pm] Registering accessory 'homebridge-cmd4.Cmd4' [29/07/2024, 2:06:02 pm] Registering platform 'homebridge-cmd4.Cmd4' [29/07/2024, 2:06:02 pm] [Cmd4] Loaded homebridge-cmd4 v8.0.0-beta.3 child bridge successfully [29/07/2024, 2:06:02 pm] Loaded 16 cached accessories from cachedAccessories.0EF085EB9153. [29/07/2024, 2:06:02 pm] [Cmd4] Cmd4Platform didFinishLaunching [29/07/2024, 2:06:02 pm] [Cmd4] Restoring existing accessory from cache: Aircon [29/07/2024, 2:06:05 pm] [Cmd4] Creating linked accessories for: Aircon [29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Aircon Fan [29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Aircon Timer [29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Living Room Zone [29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Theater Zone [29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Bedroom Zone [29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Craft Room Zone [29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Guest Room Zone [29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Nursery Zone [29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Living Room Temperature [29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Theater Temperature [29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Bedroom Temperature [29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Craft Room Temperature [29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Guest Room Temperature [29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Nursery Temperature [29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: PS5 [29/07/2024, 2:06:05 pm] [Cmd4] Adding new platformAccessory: Hisense [29/07/2024, 2:06:05 pm] [Cmd4] Configuring platformAccessory: Hisense [29/07/2024, 2:06:05 pm] [Cmd4] Creating accessories for: Hisense [29/07/2024, 2:06:05 pm] [Cmd4] Creating linked accessories for: Hisense [29/07/2024, 2:06:05 pm] [Cmd4] Cmd4 is running in Demo Mode for TV [29/07/2024, 2:06:05 pm] [Cmd4] Cmd4 is running in Demo Mode for HDMI1 [29/07/2024, 2:06:05 pm] [Cmd4] Cmd4 is running in Demo Mode for HDMI2 [29/07/2024, 2:06:05 pm] [Cmd4] Cmd4 is running in Demo Mode for HDMI3 [29/07/2024, 2:06:05 pm] [Cmd4] Cmd4 is running in Demo Mode for HDMI4 [29/07/2024, 2:06:05 pm] [Cmd4] Cmd4 is running in Demo Mode for AV HAP-NodeJS WARNING: The accessory 'My_TelevisionSpeaker' has an invalid 'Name' characteristic ('My_TelevisionSpeaker'). Please use only alphanumeric, space, and apostrophe characters. Ensure it starts and ends with an alphabetic or numeric character, and avoid emojis. This may prevent the accessory from being added in the Home App or cause unresponsiveness. [29/07/2024, 2:06:05 pm] [Cmd4] Accessory Aircon will be removed. [29/07/2024, 2:06:05 pm] [Cmd4] Accessory Aircon Fan will be removed. [29/07/2024, 2:06:05 pm] [Cmd4] Accessory Aircon Timer will be removed. [29/07/2024, 2:06:05 pm] [Cmd4] Accessory Living Room Zone will be removed. [29/07/2024, 2:06:05 pm] [Cmd4] Accessory Theater Zone will be removed. [29/07/2024, 2:06:05 pm] [Cmd4] Accessory Bedroom Zone will be removed. [29/07/2024, 2:06:05 pm] [Cmd4] Accessory Craft Room Zone will be removed. [29/07/2024, 2:06:05 pm] [Cmd4] Accessory Guest Room Zone will be removed. [29/07/2024, 2:06:05 pm] [Cmd4] Accessory Nursery Zone will be removed. [29/07/2024, 2:06:05 pm] [Cmd4] Accessory Living Room Temperature will be removed. [29/07/2024, 2:06:05 pm] [Cmd4] Accessory Theater Temperature will be removed. [29/07/2024, 2:06:05 pm] [Cmd4] Accessory Bedroom Temperature will be removed. [29/07/2024, 2:06:06 pm] [Cmd4] Accessory Craft Room Temperature will be removed. [29/07/2024, 2:06:06 pm] [Cmd4] Accessory Guest Room Temperature will be removed. [29/07/2024, 2:06:06 pm] [Cmd4] Accessory Nursery Temperature will be removed. [29/07/2024, 2:06:06 pm] [Cmd4] Accessory PS5 will be removed. [29/07/2024, 2:06:06 pm] Homebridge v1.8.5-beta.4 (HAP v0.12.3-beta.26) (Cmd4) is running on port 46526. [29/07/2024, 2:06:06 pm]

NOTICE TO USERS AND PLUGIN DEVELOPERS

Homebridge 2.0 is on the way and brings some breaking changes to existing plugins. Please visit the following link to learn more about the changes and how to prepare: https://github.com/homebridge/homebridge/wiki/Updating-To-Homebridge-v2.0

[29/07/2024, 2:06:06 pm] Hisense E7B5 is running on port 33431. [29/07/2024, 2:06:06 pm] Please add [Hisense E7B5] manually in Home app. Setup Code: 592-12-550 [29/07/2024, 2:06:46 pm] [Cmd4] Starting Polling [29/07/2024, 2:08:49 pm] [Cmd4] All characteristics are now being polled

The only thing it complains about is the following:

HAP-NodeJS WARNING: The accessory 'My_TelevisionSpeaker' has an invalid 'Name' characteristic ('My_TelevisionSpeaker'). Please use only alphanumeric, space, and apostrophe characters. Ensure it starts and ends with an alphabetic or numeric character, and avoid emojis. This may prevent the accessory from being added in the Home App or cause unresponsiveness.

Is there an easy way for you to set up all services/charateristics and see which ones complain? As it stands this works perfectly for my AdvAir plug-in, but others might still have warnings like I do for my Hisense TV setup through your plug-in.

— Reply to this email directly, view it on GitHub https://github.com/ztalbot2000/homebridge-cmd4/issues/146#issuecomment-2255023012, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBCX7UWNGLIMVNH4452YLZOXMKNAVCNFSM6AAAAABLN3PZCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJVGAZDGMBRGI . You are receiving this because you were mentioned.Message ID: @.***>

ztalbot2000 commented 4 months ago

Hey Mitch,

As for the MyTelevisionSpeaker, you have to remove the underscore character "" in the name. It's not my message but Homebridge's.

Ttyl, John

On Mon, Jul 29, 2024 at 7:19 AM John Talbot @.***> wrote:

Hi Mitch,

Beta 3 works, but beta 4 doesn't. Did I understand you correctly? If that's correct that's very annoying. I'll check it out.

Ttyl, John

On Mon, Jul 29, 2024 at 2:11 AM Mitch Williams @.***> wrote:

Hey John, looks like Cmd4 v8.0.0-beta.3 is working for me on Homebridge v2 and no more crashing:

[29/07/2024, 2:05:49 pm] [Cmd4] Restarting child bridge... [29/07/2024, 2:05:49 pm] Got SIGTERM, shutting down child bridge process... [29/07/2024, 2:05:54 pm] [Cmd4] Child bridge process ended [29/07/2024, 2:05:54 pm] [Cmd4] Process Ended. Code: 143, Signal: null [29/07/2024, 2:06:01 pm] [Cmd4] Restarting Process... [29/07/2024, 2:06:02 pm] [Cmd4] Launched child bridge with PID 20796 [29/07/2024, 2:06:02 pm] Registering accessory 'homebridge-cmd4.Cmd4' [29/07/2024, 2:06:02 pm] Registering platform 'homebridge-cmd4.Cmd4' [29/07/2024, 2:06:02 pm] [Cmd4] Loaded homebridge-cmd4 v8.0.0-beta.3 child bridge successfully [29/07/2024, 2:06:02 pm] Loaded 16 cached accessories from cachedAccessories.0EF085EB9153. [29/07/2024, 2:06:02 pm] [Cmd4] Cmd4Platform didFinishLaunching [29/07/2024, 2:06:02 pm] [Cmd4] Restoring existing accessory from cache: Aircon [29/07/2024, 2:06:05 pm] [Cmd4] Creating linked accessories for: Aircon [29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Aircon Fan [29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Aircon Timer [29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Living Room Zone [29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Theater Zone [29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Bedroom Zone [29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Craft Room Zone [29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Guest Room Zone [29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Nursery Zone [29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Living Room Temperature [29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Theater Temperature [29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Bedroom Temperature [29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Craft Room Temperature [29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Guest Room Temperature [29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: Nursery Temperature [29/07/2024, 2:06:05 pm] [Cmd4] Restoring existing accessory from cache: PS5 [29/07/2024, 2:06:05 pm] [Cmd4] Adding new platformAccessory: Hisense [29/07/2024, 2:06:05 pm] [Cmd4] Configuring platformAccessory: Hisense [29/07/2024, 2:06:05 pm] [Cmd4] Creating accessories for: Hisense [29/07/2024, 2:06:05 pm] [Cmd4] Creating linked accessories for: Hisense [29/07/2024, 2:06:05 pm] [Cmd4] Cmd4 is running in Demo Mode for TV [29/07/2024, 2:06:05 pm] [Cmd4] Cmd4 is running in Demo Mode for HDMI1 [29/07/2024, 2:06:05 pm] [Cmd4] Cmd4 is running in Demo Mode for HDMI2 [29/07/2024, 2:06:05 pm] [Cmd4] Cmd4 is running in Demo Mode for HDMI3 [29/07/2024, 2:06:05 pm] [Cmd4] Cmd4 is running in Demo Mode for HDMI4 [29/07/2024, 2:06:05 pm] [Cmd4] Cmd4 is running in Demo Mode for AV HAP-NodeJS WARNING: The accessory 'My_TelevisionSpeaker' has an invalid 'Name' characteristic ('My_TelevisionSpeaker'). Please use only alphanumeric, space, and apostrophe characters. Ensure it starts and ends with an alphabetic or numeric character, and avoid emojis. This may prevent the accessory from being added in the Home App or cause unresponsiveness. [29/07/2024, 2:06:05 pm] [Cmd4] Accessory Aircon will be removed. [29/07/2024, 2:06:05 pm] [Cmd4] Accessory Aircon Fan will be removed. [29/07/2024, 2:06:05 pm] [Cmd4] Accessory Aircon Timer will be removed. [29/07/2024, 2:06:05 pm] [Cmd4] Accessory Living Room Zone will be removed. [29/07/2024, 2:06:05 pm] [Cmd4] Accessory Theater Zone will be removed. [29/07/2024, 2:06:05 pm] [Cmd4] Accessory Bedroom Zone will be removed. [29/07/2024, 2:06:05 pm] [Cmd4] Accessory Craft Room Zone will be removed. [29/07/2024, 2:06:05 pm] [Cmd4] Accessory Guest Room Zone will be removed. [29/07/2024, 2:06:05 pm] [Cmd4] Accessory Nursery Zone will be removed. [29/07/2024, 2:06:05 pm] [Cmd4] Accessory Living Room Temperature will be removed. [29/07/2024, 2:06:05 pm] [Cmd4] Accessory Theater Temperature will be removed. [29/07/2024, 2:06:05 pm] [Cmd4] Accessory Bedroom Temperature will be removed. [29/07/2024, 2:06:06 pm] [Cmd4] Accessory Craft Room Temperature will be removed. [29/07/2024, 2:06:06 pm] [Cmd4] Accessory Guest Room Temperature will be removed. [29/07/2024, 2:06:06 pm] [Cmd4] Accessory Nursery Temperature will be removed. [29/07/2024, 2:06:06 pm] [Cmd4] Accessory PS5 will be removed. [29/07/2024, 2:06:06 pm] Homebridge v1.8.5-beta.4 (HAP v0.12.3-beta.26) (Cmd4) is running on port 46526. [29/07/2024, 2:06:06 pm]

NOTICE TO USERS AND PLUGIN DEVELOPERS

Homebridge 2.0 is on the way and brings some breaking changes to existing plugins. Please visit the following link to learn more about the changes and how to prepare: https://github.com/homebridge/homebridge/wiki/Updating-To-Homebridge-v2.0

[29/07/2024, 2:06:06 pm] Hisense E7B5 is running on port 33431. [29/07/2024, 2:06:06 pm] Please add [Hisense E7B5] manually in Home app. Setup Code: 592-12-550 [29/07/2024, 2:06:46 pm] [Cmd4] Starting Polling [29/07/2024, 2:08:49 pm] [Cmd4] All characteristics are now being polled

The only thing it complains about is the following:

HAP-NodeJS WARNING: The accessory 'My_TelevisionSpeaker' has an invalid 'Name' characteristic ('My_TelevisionSpeaker'). Please use only alphanumeric, space, and apostrophe characters. Ensure it starts and ends with an alphabetic or numeric character, and avoid emojis. This may prevent the accessory from being added in the Home App or cause unresponsiveness.

Is there an easy way for you to set up all services/charateristics and see which ones complain? As it stands this works perfectly for my AdvAir plug-in, but others might still have warnings like I do for my Hisense TV setup through your plug-in.

— Reply to this email directly, view it on GitHub https://github.com/ztalbot2000/homebridge-cmd4/issues/146#issuecomment-2255023012, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBCX7UWNGLIMVNH4452YLZOXMKNAVCNFSM6AAAAABLN3PZCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJVGAZDGMBRGI . You are receiving this because you were mentioned.Message ID: @.***>

mitch7391 commented 4 months ago

Hey John, can’t see a beta 4 in your releases, I have only tested beta 3 and it works, only issue is how it removes all my accessories and re-adds them…

mitch7391 commented 4 months ago

As for the MyTelevisionSpeaker, you have to remove the underscore character "" in the name.

I can see that in my config now as something have I defined (probably copied from your sample config but never changed myself). Didn’t notice this, sorry haha my brain has turned to mush since having the twins…

ztalbot2000 commented 4 months ago

Hey Mitch,

My brain is fried too. There was no beta 4.

Ttyl, John

On Mon, Jul 29, 2024 at 7:27 AM Mitch Williams @.***> wrote:

As for the MyTelevisionSpeaker, you have to remove the underscore character "" in the name.

I can see that in my config now as something have I defined (probably copied from your sample config but never changed myself). Didn’t notice this, sorry haha my brain has turned to mush since having the twins…

— Reply to this email directly, view it on GitHub https://github.com/ztalbot2000/homebridge-cmd4/issues/146#issuecomment-2255681652, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBCX4MQIOSBROHWQ6IX2DZOYRLFAVCNFSM6AAAAABLN3PZCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJVGY4DCNRVGI . You are receiving this because you were mentioned.Message ID: @.***>

mitch7391 commented 4 months ago

I can’t speak for all your users but I would say your changes fix things for my users :) or at least it does for my setup…

ztalbot2000 commented 4 months ago

Hi Mitch,

So Cmd4 has 11153 test cases. I just submitted beta 4. This fixes a lot of the test cases that fail in homebridge v2. They changed a lot of perms from READ to PAIRED_READ. They also obsoleted more devices. BatteryService for distance changed to Battery. I now have only 48 test cases that fail.

I did notice that when I move from homebridge v1.8 to V2 the deleted accessory message and the same when I move back to v1.8, This deleted message does not occur if you run the same version of homebridge consecutively.

ttyl, John

On Mon, Jul 29, 2024 at 7:34 AM Mitch Williams @.***> wrote:

I can’t speak for all your users but I would say your changes fix things for my users :) or at least it does for my setup…

— Reply to this email directly, view it on GitHub https://github.com/ztalbot2000/homebridge-cmd4/issues/146#issuecomment-2255693867, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBCX2LKDCSI6A5BVHZ2FLZOYSDBAVCNFSM6AAAAABLN3PZCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJVGY4TGOBWG4 . You are receiving this because you were mentioned.Message ID: @.***>

ztalbot2000 commented 4 months ago

Hi Mitch,

Getting closer. Down to 25 failing unit tests. I only use characteristic.getValue in unit tests and that is deprecated. I'll get to it tomorrow. Beta 5 is the one you want to test. It passes get/set in the priorityPollingQueue. Homebridge V2 removed Perms.READ and Perms.WRITE which was causing a lot of issues. Fakegato-history was also fixed, but you don't use that.

ttyl, John

On Mon, Jul 29, 2024 at 1:06 PM John Talbot @.***> wrote:

Hi Mitch,

So Cmd4 has 11153 test cases. I just submitted beta 4. This fixes a lot of the test cases that fail in homebridge v2. They changed a lot of perms from READ to PAIRED_READ. They also obsoleted more devices. BatteryService for distance changed to Battery. I now have only 48 test cases that fail.

I did notice that when I move from homebridge v1.8 to V2 the deleted accessory message and the same when I move back to v1.8, This deleted message does not occur if you run the same version of homebridge consecutively.

ttyl, John

On Mon, Jul 29, 2024 at 7:34 AM Mitch Williams @.***> wrote:

I can’t speak for all your users but I would say your changes fix things for my users :) or at least it does for my setup…

— Reply to this email directly, view it on GitHub https://github.com/ztalbot2000/homebridge-cmd4/issues/146#issuecomment-2255693867, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBCX2LKDCSI6A5BVHZ2FLZOYSDBAVCNFSM6AAAAABLN3PZCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJVGY4TGOBWG4 . You are receiving this because you were mentioned.Message ID: @.***>

mitch7391 commented 4 months ago

Hey John, will give beta 5 a go tomorrow. It kept failing to update for me today, which I have had happen in the past with other plugins and a physical reboot of my RPi fixed it. I was busy testing some other stuff on my RPi today and did not want to have to reboot it just yet; sorry for the hold up!

ztalbot2000 commented 4 months ago

Hey Mitch,

So beta6 is now available. All unit tests pass. This should be the final version. I set the package.json to also be V2 compatible as per homebridges recommendations for V2 required changes.

ttyl, John

On Tue, Jul 30, 2024 at 9:11 AM Mitch Williams @.***> wrote:

Hey John, will give beta 5 a go tomorrow. It kept failing to update for me today, which I have had happen in the past with other plugins and a physical reboot of my RPi fixed it. I was busy testing some other stuff on my RPi today and did not want to have to reboot it just yet; sorry for the hold up!

— Reply to this email directly, view it on GitHub https://github.com/ztalbot2000/homebridge-cmd4/issues/146#issuecomment-2258318521, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBCXZIYC7OEIDS2Z5TJTDZO6GJZAVCNFSM6AAAAABLN3PZCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJYGMYTQNJSGE . You are receiving this because you were mentioned.Message ID: @.***>

mitch7391 commented 4 months ago

Hey John, just tried the your beta 6 on on Homebridge latest and looks all good. I am about to test on the Homebridge beta but have just now noticed they also have an alpha, which version of theirs should I be testing this on, v1.8.5-beta.5 or v2.0.0-alpha.3?

ztalbot2000 commented 4 months ago

Hey Mitch,

1.8.5 is just a fix branch. I thought they were farther along in their 2.0 than alpha. I had just done a git fetch of their latest and assumed it was their 2.0 beta stuff. Since you have your own Cmd4MyPlace I guess I don't have to worry about homebridge beta. No need for you to test Cmd4 either, but thanks anyway.

Ttyl, John

On Tue, Jul 30, 2024 at 11:47 PM Mitch Williams @.***> wrote:

Hey John, just tried the your beta 6 on on Homebridge latest and looks all good. I am about to test on the Homebridge beta but have just now noticed they also have an alpha, which version of theirs should I be testing this on, v1.8.5-beta.5 or v2.0.0-alpha.3?

— Reply to this email directly, view it on GitHub https://github.com/ztalbot2000/homebridge-cmd4/issues/146#issuecomment-2259587475, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBCXYFKPCFRWHH62TQ4M3ZPBM57AVCNFSM6AAAAABLN3PZCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJZGU4DONBXGU . You are receiving this because you were mentioned.Message ID: @.***>

mitch7391 commented 4 months ago

Hey John, my plugin homebridge-cmd4-advantageair greatly depends on your plugin still. Any discussions and work with Ung Sing about adopting Cmd4 into AdvAir has not been applied to my plugin, he has adapted it into his own stand alone plugin. Myself and my users will still rely heavily on your good work here :)

mitch7391 commented 4 months ago

I also don’t understand which is supposed to be the more updated version of theirs, the alpha or the beta?

ztalbot2000 commented 3 months ago

Closed with the release of Cmd4 v8.0.0

uswong commented 3 months ago

Hey John,

I have a good test of your Cmd4 v8.0.0 with Homebridge_v2 and I noticed that the accessory.reachable on line 126 of module Cmd5Platform.js is undefined. This will unintentionally trigger the removable of all the accessories restored from the cache. And we have to restart Homebridge to re-create the accessories. If you restart Homebridge again, all accessories will again be removed and the cycle goes on...

Screen Shot 2024-08-03 at 9 42 29 pm

Since the updateReachability function is deprecated for Homebridge_v2, the reachability in general is no longer supported. As such, the "accessory.reachable" can no longer be used. Is there any alternative we can use? Would you please take a look at that? Thanks!

Best regards, Ung Sing

mitch7391 commented 3 months ago

Nice catch Ung Sing, that would explain what I was mentioning here and still seem to be facing:

only issue is how it removes all my accessories and re-adds them…

ztalbot2000 commented 3 months ago

Hi guys,

I'm not sure about that. I only see removing accessories when you move from Homebridge 1.8 to 2.0 or back to 1.8 from 2.0. Running either consecutively, it does not happen. That whole code block is from the Homebridge Platform template. I'll still look into it though. At the moment I only have time to write this email.

Ttyl, John

On Sat, Aug 3, 2024 at 3:53 PM Mitch Williams @.***> wrote:

Nice catch Ung Sing, that would explain what I was mentioning here and still seem to be facing:

only issue is how it removes all my accessories and re-adds them…

— Reply to this email directly, view it on GitHub https://github.com/ztalbot2000/homebridge-cmd4/issues/146#issuecomment-2267117990, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBCX5SNAJTYIZWNVFB4D3ZPUYM3AVCNFSM6AAAAABLN3PZCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRXGEYTOOJZGA . You are receiving this because you modified the open/close state.Message ID: @.***>

mitch7391 commented 3 months ago

Hey John, been a bit too busy to push it more and was unsure if it was just a me issue, but none of my other Homebridge plugins are doing this when on v2, only Cmd4. I have noticed it will not create the accessories after removing them and they are gone from my HomeKit. I will reboot my Cmd4 child bridge and they will get recreated after polling. Each time I reboot HomeKit there is a good 50/50 they are all gone again or some are gone and I have to reboot again to resolve.

ddong3000 commented 3 months ago

hey this ploblem also to me. after homebridge restart or container restart my accessories was disappear at v8.0.0. and the childe bridge was set unintentionally. so i was back to the v7.1.0. plz check for us.

uswong commented 3 months ago

Hi John,

As far as I can understand, what the users have been experiencing is due to the fact that the updateReachability (deprecated on Homebridge_v2) was removed on Cmd4 v8.0.0, as such, the accesssory.reachable on line 126 of Cmd5Platform.js becomes undefined when run with Homebridge_v2 or False when run with Homebridge_v1.8.4. In both cases, the restored accessory will all be removed as per code block between lines 126-128.

In place of updateReachability, I experimented with storing the UUID of all processed accessories, which may include all or some of the accessories restored from cache, in a JSON array:

image

then use that JSON array to check which accessories were NOT restored and need to be deleted.

image

I know this seems like a band aid solution and probably a kludge, but it worked! In any case, I just want to share with you what I did in my spare time for your reference.

uswong commented 3 months ago

My edited version of Cmd4Platform.js can be found here for your reference: https://github.com/uswong/homebridge-cmd4/blob/master/Cmd4Platform.js

ztalbot2000 commented 3 months ago

Hi Guys,

So I still have not had time to really research this, other than I believe the Homebridge platform template does not provide this either. I may get to it soon, but if you think that their code is not backward compatible, then it might be their issue.

I have had multiple major problems of my own to deal with and won't be available until next week.

Ttyl, John

On Tue, Aug 6, 2024 at 11:34 PM Ung Sing Wong @.***> wrote:

My edited version of Cmd4Platform.js can be found here for your reference: https://github.com/uswong/homebridge-cmd4/blob/master/Cmd4Platform.js

— Reply to this email directly, view it on GitHub https://github.com/ztalbot2000/homebridge-cmd4/issues/146#issuecomment-2272549631, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBCX7PNTWEKYACQHXRW33ZQGIUBAVCNFSM6AAAAABLN3PZCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZSGU2DSNRTGE . You are receiving this because you modified the open/close state.Message ID: @.***>

uswong commented 3 months ago

Hey John,

My third attempt to resolve the unintended removal of restored accessories.

Since updateReachability() function and the key reachable are deprecated on Homebridge_v2, we just need to define the key reachable and set it to true for the accessory restored from cache. Just need one addition line of code in Cmd4Platform.js:

Screen Shot 2024-08-12 at 10 55 39 pm

This worked well.

Cheers, Ung Sing

uswong commented 3 months ago

The modified Cmd4Platform.js with that one additional line of code can be found in:

https://github.com/uswong/homebridge-cmd4/blob/master/Cmd4Platform.js

@mitch7391, would you please test this out on your system if you have a moment. Thanks.

mitch7391 commented 3 months ago

Thanks Ung Sing, will try to take a look tonight or tomorrow night; we have family from Tassie over to see the twins at the moment :)

mitch7391 commented 3 months ago

@uswong just gave your fix a go and it works for me. We may just need to check if hardcoding a 'true' is something we should permanently do (is there a time where it needs to read a 'false'?). I will keep the changes in for the time being to monitor and see what John comes back with. Going to re-open this issue seen as it is still an issue.

uswong commented 3 months ago

Hey @mitch7391, the added line of code existingAccessory.reachable = true in Cmd4Platform.js is just to replace the deprecated updateReachability( ture ). So, it does not do anything more than before.

existingAccessory.reachable is always false with homebridge v1.8 and always undefined with homebridge v2.0 until we set it to true. If it is not set to true, all restored accessories will be removed. The function updateReachability( true ) was used to set it to true with homebridge v1.8 but that function was deprecated with hombridge v2.0. Therefore we need to set it to true explicitly with homebridge v2.0. And that is what the proposed fix does.

Hope John can have a moment to have a look at this proposed fix soon. It certainly looks like there are quite a few people having this issue.

mitch7391 commented 3 months ago

Good point Ung Sing, I had looked over the commit change (the before vs after) but a tired brain did not let that sink in properly! Sounds like a win to me, let’s see what John says when he has a moment.

ztalbot2000 commented 3 months ago

Hi all,

So I did a little check last night. While it says it is being removed. They are the old stored format. If you wait a minute, you will see polling begin, so the devices are still there. Running Cmd4 again and you do not see the removing accessory message.

On Thu, Aug 15, 2024 at 7:00 AM Ung Sing Wong @.***> wrote:

Hey @mitch7391 https://github.com/mitch7391, the added line of code existingAccessory.reachable = true in Cmd4Platform.js is just to replace the deprecated updateReachability( ture ) . So, it does not do anything more than before.

existingAccessory.reachable is always false with homebridge v1.8 and always undefined with homebridge v2.0 until we set it to true. If it is not set to true, all restored accessories will be removed. The function updateReachability( true ) was used to set it to true with homebridge v1.8 but that function was deprecated with hombridge v2.0. Therefore we need to set it to true explicitly with homebridge v2.0. And that is what the proposed fix does.

Hope John can have a moment to have a look at this proposed fix soon. It certainly looks like there are quite a few people having this issue.

— Reply to this email directly, view it on GitHub https://github.com/ztalbot2000/homebridge-cmd4/issues/146#issuecomment-2291074874, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBCX5LAVXHAM7PWOQ6H5LZRSC43AVCNFSM6AAAAABLN3PZCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJRGA3TIOBXGQ . You are receiving this because you modified the open/close state.Message ID: @.***>

uswong commented 3 months ago

Hi John,

if you run Cmd4 the third time, you will see the removing accessory message again.... It does not matter you run Cmd4 in Homebridge 1.8 or 2.0, the behavior is the same.

If the accessory is restored from cache, it will always be removed, then the 2nd Cmd4 run will re-create the accessory, then the 3rd run will restore the accessory from cache and immediately will be removed again, and this cycle of Restoring-Removing-Recreating-Restoring-Removing will go on and on....

This behavior persists because the key reachable is either false (with homebrige 1.8) or undefined (with homebridge 2.0). One way to break this behavior is to set the key reachable to true if the accessory is restored from cache. And this can be achieved by inserting a line of code after line 474 in Cmd4Platform.js: existingAccessory.reachable = true;

ztalbot2000 commented 3 months ago

Hi Sing,

Do you not think this should be a homebridge bug then?

Ttyl, John

On Thu, Aug 15, 2024 at 12:21 PM Ung Sing Wong @.***> wrote:

Hi John,

if you run Cmd4 the third time, you will see the removing accessory message again.... It does not matter you run Cmd4 in Homebridge 1.8 or 2.0, the behavior is the same.

If the accessory is restored from cache, it will always be removed, then the 2nd Cmd4 run will re-create the accessory, then the 3rd run will restore the accessory from cache and immediately will be removed again, and this cycle of Restoring-Removing-Recreating-Restoring-Removing will go on and on....

This behavior persists because the key reachable is either false (with homebrige 1.8) or undefined (with homebridge 2.0). One way to break this behavior is to set the key reachable to true if the accessory is restored from cache. And this can be achieved by inserting a line of code after line 474 in Cmd4Platform.js: existingAccessory.reachable = true;

— Reply to this email directly, view it on GitHub https://github.com/ztalbot2000/homebridge-cmd4/issues/146#issuecomment-2291640896, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBCX7OHNZ3ZUNQXJ7B7NDZRTIPBAVCNFSM6AAAAABLN3PZCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJRGY2DAOBZGY . You are receiving this because you modified the open/close state.Message ID: @.***>

uswong commented 3 months ago

Hi John,

I do not think it is a homebridge bug. However, they did deprecat “updateReachabity()” function, so we will need to replace that with an explicit code to set the “reachable” to ‘true’ for those accessories restored from cache. Otherwise, reachable is always false or undefined and that will trigger the removal of accessory.

On Fri, 16 Aug 2024 at 00:35 John Talbot @.***> wrote:

Hi Sing,

Do you not think this should be a homebridge bug then?

Ttyl, John

On Thu, Aug 15, 2024 at 12:21 PM Ung Sing Wong @.***> wrote:

Hi John,

if you run Cmd4 the third time, you will see the removing accessory message again.... It does not matter you run Cmd4 in Homebridge 1.8 or 2.0, the behavior is the same.

If the accessory is restored from cache, it will always be removed, then the 2nd Cmd4 run will re-create the accessory, then the 3rd run will restore the accessory from cache and immediately will be removed again, and this cycle of Restoring-Removing-Recreating-Restoring-Removing will go on and on....

This behavior persists because the key reachable is either false (with homebrige 1.8) or undefined (with homebridge 2.0). One way to break this behavior is to set the key reachable to true if the accessory is restored from cache. And this can be achieved by inserting a line of code after line 474 in Cmd4Platform.js: existingAccessory.reachable = true;

— Reply to this email directly, view it on GitHub < https://github.com/ztalbot2000/homebridge-cmd4/issues/146#issuecomment-2291640896>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABSBCX7OHNZ3ZUNQXJ7B7NDZRTIPBAVCNFSM6AAAAABLN3PZCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJRGY2DAOBZGY>

. You are receiving this because you modified the open/close state.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/ztalbot2000/homebridge-cmd4/issues/146#issuecomment-2291682947, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXAO6PKUXXJ4RSHL6DGVREDZRTKGRAVCNFSM6AAAAABLN3PZCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJRGY4DEOJUG4 . You are receiving this because you were mentioned.Message ID: @.***>

ztalbot2000 commented 3 months ago

Hey Sing,

They did deprecate it but if their template does not handle accessories being restored properly, then all plugins will have this issue and they have a problem.

Ttyl, John

On Thu, Aug 15, 2024 at 1:01 PM Ung Sing Wong @.***> wrote:

Hi John,

I do not think it is a homebridge bug. However, they did deprecat “updateReachabity()” function, so we will need to replace that with an explicit code to set the “reachable” to ‘true’ for those accessories restored from cache. Otherwise, reachable is always false or undefined and that will trigger the removal of accessory.

On Fri, 16 Aug 2024 at 00:35 John Talbot @.***> wrote:

Hi Sing,

Do you not think this should be a homebridge bug then?

Ttyl, John

On Thu, Aug 15, 2024 at 12:21 PM Ung Sing Wong @.***> wrote:

Hi John,

if you run Cmd4 the third time, you will see the removing accessory message again.... It does not matter you run Cmd4 in Homebridge 1.8 or 2.0, the behavior is the same.

If the accessory is restored from cache, it will always be removed, then the 2nd Cmd4 run will re-create the accessory, then the 3rd run will restore the accessory from cache and immediately will be removed again, and this cycle of Restoring-Removing-Recreating-Restoring-Removing will go on and on....

This behavior persists because the key reachable is either false (with homebrige 1.8) or undefined (with homebridge 2.0). One way to break this behavior is to set the key reachable to true if the accessory is restored from cache. And this can be achieved by inserting a line of code after line 474 in Cmd4Platform.js: existingAccessory.reachable = true;

— Reply to this email directly, view it on GitHub <

https://github.com/ztalbot2000/homebridge-cmd4/issues/146#issuecomment-2291640896>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABSBCX7OHNZ3ZUNQXJ7B7NDZRTIPBAVCNFSM6AAAAABLN3PZCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJRGY2DAOBZGY>

. You are receiving this because you modified the open/close state.Message ID: @.***>

— Reply to this email directly, view it on GitHub < https://github.com/ztalbot2000/homebridge-cmd4/issues/146#issuecomment-2291682947>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AXAO6PKUXXJ4RSHL6DGVREDZRTKGRAVCNFSM6AAAAABLN3PZCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJRGY4DEOJUG4>

. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/ztalbot2000/homebridge-cmd4/issues/146#issuecomment-2291723852, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBCX5A57TQ2XF73G5ZANTZRTNGFAVCNFSM6AAAAABLN3PZCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJRG4ZDGOBVGI . You are receiving this because you modified the open/close state.Message ID: @.***>

ztalbot2000 commented 3 months ago

Hi,

Weird. It does happen like you said on the third attempt. We need to take the Homebridge template and prove the same so all plugins will benefit.

Ttyl, John

On Thu, Aug 15, 2024 at 1:46 PM John Talbot @.***> wrote:

Hey Sing,

They did deprecate it but if their template does not handle accessories being restored properly, then all plugins will have this issue and they have a problem.

Ttyl, John

On Thu, Aug 15, 2024 at 1:01 PM Ung Sing Wong @.***> wrote:

Hi John,

I do not think it is a homebridge bug. However, they did deprecat “updateReachabity()” function, so we will need to replace that with an explicit code to set the “reachable” to ‘true’ for those accessories restored from cache. Otherwise, reachable is always false or undefined and that will trigger the removal of accessory.

On Fri, 16 Aug 2024 at 00:35 John Talbot @.***> wrote:

Hi Sing,

Do you not think this should be a homebridge bug then?

Ttyl, John

On Thu, Aug 15, 2024 at 12:21 PM Ung Sing Wong @.***> wrote:

Hi John,

if you run Cmd4 the third time, you will see the removing accessory message again.... It does not matter you run Cmd4 in Homebridge 1.8 or 2.0, the behavior is the same.

If the accessory is restored from cache, it will always be removed, then the 2nd Cmd4 run will re-create the accessory, then the 3rd run will restore the accessory from cache and immediately will be removed again, and this cycle of Restoring-Removing-Recreating-Restoring-Removing will go on and on....

This behavior persists because the key reachable is either false (with homebrige 1.8) or undefined (with homebridge 2.0). One way to break this behavior is to set the key reachable to true if the accessory is restored from cache. And this can be achieved by inserting a line of code after line 474 in Cmd4Platform.js: existingAccessory.reachable = true;

— Reply to this email directly, view it on GitHub <

https://github.com/ztalbot2000/homebridge-cmd4/issues/146#issuecomment-2291640896>,

or unsubscribe <

https://github.com/notifications/unsubscribe-auth/ABSBCX7OHNZ3ZUNQXJ7B7NDZRTIPBAVCNFSM6AAAAABLN3PZCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJRGY2DAOBZGY>

. You are receiving this because you modified the open/close state.Message ID: @.***>

— Reply to this email directly, view it on GitHub < https://github.com/ztalbot2000/homebridge-cmd4/issues/146#issuecomment-2291682947>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AXAO6PKUXXJ4RSHL6DGVREDZRTKGRAVCNFSM6AAAAABLN3PZCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJRGY4DEOJUG4>

. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/ztalbot2000/homebridge-cmd4/issues/146#issuecomment-2291723852, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBCX5A57TQ2XF73G5ZANTZRTNGFAVCNFSM6AAAAABLN3PZCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJRG4ZDGOBVGI . You are receiving this because you modified the open/close state.Message ID: @.***>

uswong commented 3 months ago

...they did deprecate it but if their template does not handle accessories being restored properly, then all plugins will have this issue and they have a problem.

Hey John,

Their latest homebridge template does not include any logic for the removable of existing accessory from cache, it is up to the plugin developer to code the logic.

Your existing logic in Cmd4Platform.js is if ( ! accessory.reachable ) then remove the existing accessory from cache. By default reachable is false or undefined. As such, we have to define reachable and set it to true if that accessory is restored from cache and we do not want it to be removed.

My proposed fix is to add a line of code existingAccessory.reachable = true; after line 474 in Cmd4Platform.js.

It works beautifully. Please test it out for yourself.

You can find my modified version of Cmd4Platform.js here: https://github.com/uswong/homebridge-cmd4/blob/master/Cmd4Platform.js)