mskg / homey-heating

Heating scheduler for Athom Homey
https://homey-heating.mskg.app/
GNU General Public License v3.0
6 stars 6 forks source link

After updating to v 2.0.3 application stopped working. #178

Closed kvacha13 closed 1 year ago

kvacha13 commented 1 year ago

Describe the bug The app Homey Heating Scheduler has been automatically updated to version 2.0.3 and stopped working. Cannot access "Configure App" menu, application not responding..

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

mskg commented 1 year ago

Hei, thanks for the report. Which homey to you have? Can you dump the details from General / About?

mskg commented 1 year ago

I guess it's 8.0.0 ... 8.1.3?

kvacha13 commented 1 year ago

Hi, here is homey developers tool system info:

bootId | "b55a8537-6b81-42a1-99d1-71f8b85faa20" cloudId | "5a6eeacb4445b17034a0b6cc" hostname | "homey-5a6eeacb4445b17034a0b6cc" platform | "linux" release | "4.14.15-g3c513a6eca" arch | "arm" uptime | 1713 loadavg | [1.87,1.84,1.37] totalmem | 511922176 freememMachine | 21438464 freememHuman | "4%" cpus | [{"model":"ARMv7 Processor rev 10 (v7l)","speed":996,"times":{"user":256180,"nice":93840,"sys":321400,"idle":853620,"irq":0}}] date | "2023-05-01T14:08:35.116Z" dateHuman | "Monday 1st May 2023 16:08:35" dateDst | true devmode | false nodeVersion | "v12.22.11" homeyVersion | "8.1.3" homeyModelId | "homey1s" homeyModelName | "Homey (Early 2016)"

mskg commented 1 year ago

There is some dependencies missing in Atoms own APIs. That doesn't happen on the new Homey Pro, but it's a different software version. I need to check with Athom to understand how I can workaround that.

Unable to initialize app Error: Cannot find module 'socket.io-client'
Require stack:
- /node_modules/homey-api/lib/HomeyAPI/HomeyAPIV2.js
- /node_modules/homey-api/lib/AthomCloudAPI/Homey.js
- /node_modules/homey-api/lib/AthomCloudAPI/User.js
- /node_modules/homey-api/lib/AthomCloudAPI.js
- /node_modules/homey-api/index.js
- /node_modules/@app/services/index.js
- /app.js
- /opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/homey-apps-sdk-v3/lib/Util.js
- /opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/homey-apps-sdk-v3/lib/Device.js
- /opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/homey-apps-sdk-v3/homey.js
- /opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/homey-apps-sdk-v3/index.js
- /opt/homey-client/system/manager/ManagerApps/AppProcess/bootstrap.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at Module.require (/opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/homey-apps-sdk-v3/index.js:1:183)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/node_modules/homey-api/lib/HomeyAPI/HomeyAPIV2.js:3:24)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/node_modules/homey-api/lib/HomeyAPI/HomeyAPIV2.js',
    '/node_modules/homey-api/lib/AthomCloudAPI/Homey.js',
    '/node_modules/homey-api/lib/AthomCloudAPI/User.js',
    '/node_modules/homey-api/lib/AthomCloudAPI.js',
    '/node_modules/homey-api/index.js',
    '/node_modules/@app/services/index.js',
    '/app.js',
    '/opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/homey-apps-sdk-v3/lib/Util.js',
    '/opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/homey-apps-sdk-v3/lib/Device.js',
    '/opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/homey-apps-sdk-v3/homey.js',
    '/opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/homey-apps-sdk-v3/index.js',
    '/opt/homey-client/system/manager/ManagerApps/AppProcess/bootstrap.js'
  ]
}
/opt/homey-client/system/manager/ManagerApps/AppProcess/node_modules/homey-apps-sdk-v3/lib/Homey.js:1
"use strict";const path=require("path"),SimpleClass=require("./SimpleClass.js"),Manager=require("./Manager.js");class Homey extends SimpleClass{constructor(e,t,s,i,r){super(),this.dir=e,this.tmpdir=path.join(e,"tmp"),this.version=s,this.platform=i,this.platformVersion=r,this.env={},this.manifest=t,this.app={},this.__readyPromise=new Promise(e=>{this.__readyResolve=e}),this._timers=new Set,this._destroyed=!1,this.apps={},this.arp={},this.audio={},this.ble={},this.cloud={},this.clock={},this.drivers={},this.discovery={},this.flow={},this.geolocation={},this.i18n={},this.images={},this.insights={},this.ledring={},this.nfc={},this.notifications={},this.rf={},this.settings={},this.speechInput={},this.speechOutput={},this.zigbee={},this.zwave={},this.api={}}ready(){return this.__readyPromise}markReady(){this.__readyResolve()}hasPermission(e){return!1!==Array.isArray(this.manifest.permissions)&&this.manifest.permissions.includes(e)}__(e,t){}setTimeout(e,t,...s){if(this._destroyed)return null;const i=setTimeout(()=>{this._timers.delete(i),e(...s)},t);return this._timers.add(i),i}clearTimeout(e){clearTimeout(e),this._timers.delete(e)}setInterval(e,t,...s){if(this._destroyed)return null;const i=setInterval(e,t,...s);return this._timers.add(i),i}clearInterval(e){clearInterval(e),this._timers.delete(e)}destroy(){this.__debug("Homey Destroyed"),this.emit("unload"),this._destroyed=!0;for(const e of this._timers.values())clearTimeout(e);const e={emit:async e=>{throw this.__debug(`Emit after destroy ${e}`),new Error(`Cannot send "${e}" because the app instance has been destroyed.\n`+"This may indicate that your app is not cleaning up all resources in `onUninit()`.")}},t=this.app,s=this.drivers;for(const t of Object.keys(this)){const s=this[t];s instanceof Manager&&(this[t]=void 0,s.homey=void 0,s.__client=e,s.removeAllListeners(),Object.defineProperty(this,t,{get(){throw new Error(`Cannot access \`this.homey.${t}\` because the app instance has been destroyed.\n`+"This may indicate that your app is not cleaning up all resources in `onUninit()`.")}}))}this.app=void 0,Object.defineProperty(this,"app",{get(){throw new Error("Cannot access `this.homey.app` because the app instance has been destroyed.\nThis may indicate that your app is not cleaning up all resources in `onUninit()`.")}}),this.removeAllListeners(),Promise.resolve().then(()=>t.onUninit()).catch(this.error);for(const e of Object.values(s.getDrivers())){Promise.resolve().then(()=>e.onUninit()).catch(this.error);for(const t of e.getDevices())Promise.resolve().then(()=>t.onUninit()).catch(this.error)}}}module.exports=Homey;
kvacha13 commented 1 year ago

Firstly, thank you for your prompt replies and the great application (one of my favorite and most used homey applications). While you are looking for a workaround I would like to uninstall the updated version and reinstall the previous one. But got confused. The latest (that failed to work) version is 2.0.3 and what was the previous version? 1.2.0 according to the release log?

mskg commented 1 year ago

Yep, correct. 2.* is adjusted to the latest SDKs from Homey, this is why I bumped the major version.

kvacha13 commented 1 year ago

OK. I'll try to reinstall v1.2.0 but hopefully looking forward to updating it to v2.0.3. Please, let me know if you find out any workaround.

kvacha13 commented 1 year ago

Sorry for bothering you. But I am trying to reinstall v1.2.0 using cli on windows. I've downloaded zip file from github to my PC, unzipped it and from the folder I'm trying to issue "homey app install" but getting an error: Could not find a valid Homey App at 'C:\Users\Giorgio\Desktop\Homey\homey-heating-1.2.0-rc19': C:\Users\Giorgio\Desktop\Homey\homey-heating-1.2.0-rc19\app.json: ENOENT: no such file or directory, open 'C:\Users\Giorgio\Desktop\Homey\homey-heating-1.2.0-rc19\app.json'

mskg commented 1 year ago

https://github.com/mskg/homey-heating/tree/release/v1.2.4-rc1

That's the bundled application.

kvacha13 commented 1 year ago

Thank you. Installed successfully. Just for your information got following warnings: Warning: flow.actions['apply_plan'].titleFormatted is missing. Specifying a Flow card's formatted title will be required in the future. Warning: flow.actions['set_mode'].titleFormatted is missing. Specifying a Flow card's formatted title will be required in the future. Warning: flow.actions['set_log_state'].titleFormatted is missing. Specifying a Flow card's formatted title will be required in the future. Warning: flow.actions['set_plan_state'].titleFormatted is missing. Specifying a Flow card's formatted title will be required in the future. Warning: flow.actions['set_thermostat_override'].titleFormatted is missing. Specifying a Flow card's formatted title will be required in the future.

mskg commented 1 year ago

@kvacha13 would you please try "https://homey.app/a/app.mskg.homey-heating/test/"?

I spoked to their CTO and bumped the dependencies to the latest, unstable versions. I cannot test it here as I don't have an old PRO.

mskg commented 1 year ago

I see the crash report - no difference.

kvacha13 commented 1 year ago

I have tried it. Inxtalled Experimental version 2.0.4. But it immediately stops "This app has unexpectedly stopped"

kvacha13 commented 1 year ago

If you want me to try other versions too, I'm happy to do it. Otherwise, I will reinstall the previous version again (I have uninstalled it to try Experimental) :-).

mskg commented 1 year ago

@kvacha13 next try https://homey.app/a/app.mskg.homey-heating/test/. I'm confident.

kvacha13 commented 1 year ago

Thank you so much for a great job. I've reinstalled it and configured the heating plan with all the zones and devices. Working as it should be. Think you can remove Experimental :-).. Thanks.

mskg commented 1 year ago

I'm so happy that it works now ;) Published

kvacha13 commented 1 year ago

Just wanted to share some of my ideas about the app. I think it would be very convenient if the "Change heating mode" switch (Automatic, One day at home, etc.), which is available only in the application configuration, was also available in the "Device" section.

mskg commented 1 year ago

You can use flow?

kvacha13 commented 1 year ago

Sure, flows can be used in some cases but sometimes you want to change manually the main heating plan to "one day at home" or on an unplanned holiday. In my case, I use a general heating plan which sets temperatures during the day (let's say 18C) but often I need to set all thermostats to different temperatures (20 C) that could not be linked to any flow. To accomplish this I need to go to app>config and from there change the automatic plan to one day at home (or any other). Would be easier to choose a plan from the device. Just idea. :-)

mskg commented 1 year ago

You don't need to do it that way. You're aware of virtual thermostats?

https://homey-heating.mskg.app/pages/device

kvacha13 commented 1 year ago

Sure, when I mentioned the device I meant a virtual thermostat. But I've never thought that I could use the temperature dial pad of the virtual thermostat to set all thermostats. if it sets all temperatures of all thermostats at once, then there is no need for a switch to be added to a virtual thermostat. Thank you for the suggestion.

kvacha13 commented 1 year ago

Just last question. I still have the experimental version of the app as I installed it yesterday before you published it. I hope it still gets future updates, right? Or should I uninstall it and install the published one?

mskg commented 1 year ago

There is no difference in that version. It's the same binaries. Just click on install from the AppStore - so you don't need to think about that.