L0rdCha0s / homebridge-airtouch3-airconditioner

An integration between the vzduch-dotek AirTouch API and Homebridge
ISC License
0 stars 0 forks source link

Errors after initial install and configuration #2

Open Grubs opened 3 years ago

Grubs commented 3 years ago

See log attached and also accessory created in Homebridge

homebridge-airtouch3-airconditioner-error.log

Homebridge-Air-Conditioner

L0rdCha0s commented 3 years ago

Hi there!

It looks like I have to improve my error handling - but the underlying issue is that your install of vzduch-dotek (the airtouch API) is either not working, or your configuration is pointing at the wrong place.

Have you confirmed your vzduch-dotek install? See the README.md for details.

L0rdCha0s commented 3 years ago

On reflection - I've taken a look at the underlying API I depend on (vzduch-dotek), and have decided to just port the bits that are relevant straight into the plugin. This means you won't need to install the API, but it may take a few days for me to finish the code.

shard87 commented 3 years ago

Absolute Legend! Ill stay tuned.

L0rdCha0s commented 3 years ago

Shouldn't be long - got half way through today (I'm on 3 months gardening leave, need something to keep me busy!)

Grubs commented 3 years ago

@L0rdCha0s my vzduch-dotek API is working all ok. I can connect via browser to the IP and port and I'm also using it in Home Assistant. Althought if you have time I'd prefer not to have to use the API and just use a standard HA Integration oh and the Homebridge plugin without the needing the API sounds great!!!!

shard87 commented 3 years ago

Wowsers, customer service!!

L0rdCha0s commented 3 years ago

@Grubs - interesting that the current plugin isn't working if your vzduch-dotek is. Can you show me your homebridge config for the plugin please?

Grubs commented 3 years ago

sure @L0rdCha0s

Excuse the formatting. Posting on my phone

"accessories": [ { "accessory": "homebridge-airtouch3-airconditioner", "name": "Air Conditioner", "apiRoot": "http://192.168.1.13:5353/", "zones": [ { "zoneId": 0, "name": "Dining Room Zone" }, { "zoneId": 1, "name": "Lounge Room Zone" }, { "zoneId": 2, "name": "Z** Room Zone" }, { "zoneId": 3, "name": "Bedroom Zone" }, { "zoneId": 4, "name": "S** Room Zone" }, { "zoneId": 5, "name": "Garage Zone" } ] } ],

L0rdCha0s commented 3 years ago

Hi @Grubs - ah, just as I've finished the work on removing the vzduch-dotek requirement - I've seen your issue - it's the trailling '/' on your URL - you'd need 'http://192.168.1.13:5353' not 'http://192.168.1.13:5353/'

Regardless, I've just ported the C# code from vzduch-dotek to Typescript and done a few spot checks - everything seems to work.

@shard87 and @Grubs - please update your plugins, and note the new details in the README.md - basically you now need to add a new config option 'airtouchHost' - which is just the IP Address of your Airtouch panel (port can also be set, but the default value should be correct). You can remove the old 'apiRoot' item as it's no longer needed.

** Also - you no longer need vzduch-dotek at all - this new version is entirely self contained in the homebridge plugin.

Please give it a run through and make sure it works for you - the Airtouch supports a number of different configuration patterns and I can't guarantee I've covered all bases - feedback would be very useful!

shard87 commented 3 years ago

Hi @L0rdCha0s,

I've tried installing on both my Homebridge Container (slightly behind on updates) and RPi (fully up to date) but both throw the following errors:

Container: (node:31016) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 127.0.0.1:80 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) (node:31016) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 122) (node:31016) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 127.0.0.1:80 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) (node:31016) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 124) (node:31016) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 127.0.0.1:80 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) (node:31016) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 126) (node:31016) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 127.0.0.1:80 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) (node:31016) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 128)

RPi: (node:22271) UnhandledPromiseRejectionWarning: Error: Request failed with status code 400 at createError (/usr/local/lib/node_modules/homebridge-airtouch3-airconditioner/node_modules/axios/lib/core/createError.js:16:15) at settle (/usr/local/lib/node_modules/homebridge-airtouch3-airconditioner/node_modules/axios/lib/core/settle.js:17:12) at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/homebridge-airtouch3-airconditioner/node_modules/axios/lib/adapters/http.js:260:11) at IncomingMessage.emit (events.js:327:22) at endReadableNT (internal/streams/readable.js:1327:12) at processTicksAndRejections (internal/process/task_queues.js:80:21) (node:22271) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 34) (node:22271) UnhandledPromiseRejectionWarning: Error: Request failed with status code 400 at createError (/usr/local/lib/node_modules/homebridge-airtouch3-airconditioner/node_modules/axios/lib/core/createError.js:16:15) at settle (/usr/local/lib/node_modules/homebridge-airtouch3-airconditioner/node_modules/axios/lib/core/settle.js:17:12) at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/homebridge-airtouch3-airconditioner/node_modules/axios/lib/adapters/http.js:260:11) at IncomingMessage.emit (events.js:327:22) at endReadableNT (internal/streams/readable.js:1327:12) at processTicksAndRejections (internal/process/task_queues.js:80:21) (node:22271) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 36) (node:22271) UnhandledPromiseRejectionWarning: Error: Request failed with status code 400 at createError (/usr/local/lib/node_modules/homebridge-airtouch3-airconditioner/node_modules/axios/lib/core/createError.js:16:15) at settle (/usr/local/lib/node_modules/homebridge-airtouch3-airconditioner/node_modules/axios/lib/core/settle.js:17:12) at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/homebridge-airtouch3-airconditioner/node_modules/axios/lib/adapters/http.js:260:11) at IncomingMessage.emit (events.js:327:22) at endReadableNT (internal/streams/readable.js:1327:12) at processTicksAndRejections (internal/process/task_queues.js:80:21) (node:22271) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 38) (node:22271) UnhandledPromiseRejectionWarning: Error: Request failed with status code 400 at createError (/usr/local/lib/node_modules/homebridge-airtouch3-airconditioner/node_modules/axios/lib/core/createError.js:16:15) at settle (/usr/local/lib/node_modules/homebridge-airtouch3-airconditioner/node_modules/axios/lib/core/settle.js:17:12) at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/homebridge-airtouch3-airconditioner/node_modules/axios/lib/adapters/http.js:260:11) at IncomingMessage.emit (events.js:327:22) at endReadableNT (internal/streams/readable.js:1327:12) at processTicksAndRejections (internal/process/task_queues.js:80:21) (node:22271) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 40)

Both of these I've tried removing the plugin and re-installing but have had no luck as of yet...

(Thanks again!)

L0rdCha0s commented 3 years ago

Hi @shard87 ! Looks like you need to update the plugin - you're still on the old version. Make sure the homebridge UI says '1.2.0'.

Also make sure you've added the config entries for 'airtouchHost'

shard87 commented 3 years ago

Rodger; ConfigUI still lists the latest plugin at 1.0. I'll have another look..

L0rdCha0s commented 3 years ago

@shard87 Ooops - looks like my fault - have to update npm. Give me 5 mins

L0rdCha0s commented 3 years ago

@shard87 OK try now - I've just pushed the correct version to npmjs

shard87 commented 3 years ago

That's done it!! You sir are a gentleman! Absolute legend.. 🙏🏻

L0rdCha0s commented 3 years ago

Good to hear mate - enjoy - and if you run into problems of any kind or odd behaviour - please let me know so I can fix it :)

Grubs commented 3 years ago

@L0rdCha0s just did a fresh install and working all good here! Excellent work! (y)

One thing I noticed. I don't have the option for Fan only. Is that more of a HomeKit thing?

shard87 commented 3 years ago

Will do. Last question, is fan speed control possible (HomeKit limitation etc)?

L0rdCha0s commented 3 years ago

@Grubs - unfortunately yes - Homekit's 'HeaterCooler' accessory only provides options for 'auto','heat','cool' and 'off' - but not 'dry' or 'fan'..

L0rdCha0s commented 3 years ago

@shard87 Possibly yes - but in a round about way - I've seen others achieve it using a 'Window' control (because windows can be opened from 0-100% .. I'll take a look.

L0rdCha0s commented 3 years ago

Hi @shard87 and @Grubs - I've made a few key changes (update should be available in homebridge). No config changes - but some serious changes under the hood:

  1. It looks like the Airtouch was getting confused getting spammed by requests. All requests from this plugin now go to a command queue and are executed one by one every 2 seconds. Seems to be a lot more stable.
  2. I've added a 'Fan Service' to control Low/Medium/High/Auto. There seems to be a minor problem with this: Low/Medium/High are fine. When I set it to 'auto' (I've modelled this as the lowest or 'off' setting of the fan device in homekit), it seems to stay on whatever you had it set to last.. something odd is happening - even though the airtouch API is correctly saying it's set to auto, my display panel shows it as something else.

Can you both please tell me if you see similar behaviour?

shard87 commented 3 years ago

Will do, updating now..

L0rdCha0s commented 3 years ago

Thanks @shard87 .

In the meantime, there's another issue I'm working on - because Airtouch only provides commands for zone temp +1 or -1 degree (i.e. I can't set it straight from say, 21 to 25 - i have to send 4 commands : up,up,up,up ) - the current plugin gets confused if it gets a lot of temperature commands in a hurry.

Should have a fix for that soon.

L0rdCha0s commented 3 years ago

@shard87 - Actually, I think I've just fixed both of those bugs.

  1. Auto seems to work now
  2. Temperature setting quickly seems to also work.

Let me know if there are further bugs. Version is 1.3.3 with the bugfixes.

Grubs commented 3 years ago

@L0rdCha0s just updated and gave a quick test. Could see the fan speed changing all ok.

I changed the temp from 22 to 17 and I think it witnessed your delayed commands. Seemed to work well. Ended up on 17 as expected

L0rdCha0s commented 3 years ago

Yeah - as long as it gets there in the end..

Ultimately the number of commands I can send is rate limited.. just annoying that setting temperature directly isn’t supported

On 25 Mar 2021, at 8:35 pm, Grubs @.***> wrote:

 @L0rdCha0s just updated and gave a quick test. Could see the fan speed changing all ok.

I changed the temp from 22 to 17 and I think it witnessed your delayed commands. Seemed to work well. Ended up on 17 as expected

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

shard87 commented 3 years ago

All working the same as per @Grubs from my end too.

Pretty happy right now; thanks so much!

L0rdCha0s commented 3 years ago

Always good when code works :)

On 25 Mar 2021, at 9:07 pm, shard87 @.***> wrote:

 All working the same as per @Grubs from my end too.

Pretty happy right now; thanks so much!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.