Problem with new Homey Pro (2023 early)

I have an app… myIO… It works perfectly on the Sphere Homey Pro… less than 1% CPU usage, with more than 120 device…
But with the new Homey Pro it crashes with the following error if I use more than 2 device:
:warning: The app has crashed.
CPU Warning Limit Reached
I can’t do anything… I tried to run in dev mode (homey app run), but I can’t…(the same is working with the old (sphere) homey pro). I got the message:

✖ Error: No Discovery Strategies Available
    at HomeyAPIV3Local.discoverBaseUrl (/usr/local/lib/node_modules/homey/node_modules/homey-api/lib/HomeyAPI/HomeyAPIV3.js:215:13)
    at /usr/local/lib/node_modules/homey/node_modules/homey-api/lib/HomeyAPI/HomeyAPIV3.js:120:38
    at get baseUrl [as baseUrl] (/usr/local/lib/node_modules/homey/node_modules/homey-api/lib/HomeyAPI/HomeyAPIV3.js:125:7)
    at HomeyAPIV3Local.call (/usr/local/lib/node_modules/homey/node_modules/homey-api/lib/HomeyAPI/HomeyAPIV3.js:398:32)
    at ManagerUsers.__request (/usr/local/lib/node_modules/homey/node_modules/homey-api/lib/HomeyAPI/HomeyAPIV3/Manager.js:306:33)
    at ManagerUsers.value (/usr/local/lib/node_modules/homey/node_modules/homey-api/lib/HomeyAPI/HomeyAPIV3/Manager.js:207:38)
    at /usr/local/lib/node_modules/homey/node_modules/homey-api/lib/HomeyAPI/HomeyAPIV3.js:514:42
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

How can I make this app work on the new Homey Pro? Why don’t work it?

Contact the developer of the myIO app, it doesn’t have a Topic here,

myIO App for Homey | Homey

What Version of the App have you running?

1 Like

Did you tried the test version of the app?
Or send a message to the developer of the app?
Take a look at there website if there is something wrong with the app.
All that information is at the bottom of the app page.

I am the developer of the app.

Where’s the source?

1 Like

You can download from here: https://smarthomeninja.hu/files/Homey.zip

Make sure you use the latest version of homey, and also use homey app run --remote.

Otherwise, it at least seems to start fine for me:

$ homey app run --remote
✓ Pre-processing app...
✓ Validating app...
✓ App validated successfully against level `debug`
✓ Packing Homey App...
 — App archive size: 31.09 MB, 3382 files
✓ Installing Homey App on `HP2023` (https://192-168-23-9.homey.homeylocal.com)...
✓ Homey App `com.myioserver.integration` successfully installed
✓ Running `com.myioserver.integration`, press CTRL+C to quit
 — Profile your app's performance at https://go.athom.com/app-profiling?homey=63c568c7e1c0180b8a2acb02&app=com.myioserver.integration
─────────────── Logging stdout & stderr ───────────────
2023-10-21T13:10:00.153Z [log] [myIO_App] Server:  [ <1 empty item>, null ] [ <1 empty item>, null ] [ <1 empty item>, null ] [ <1 empty item>, null ]
2023-10-21T13:10:00.163Z [log] [myIO_App] Settings_updated
2023-10-21T13:10:00.166Z [log] [myIO_App] myIO_App has been initialized
2023-10-21T13:10:00.186Z [log] [ManagerDrivers] [Driver:myio_climate] myIO_Thermostat_Driver has been initialized
2023-10-21T13:10:00.186Z [log] [ManagerDrivers] [Driver:myio_cover] myIO_Cover_Driver has been initialized
2023-10-21T13:10:00.188Z [log] [ManagerDrivers] [Driver:myio_hum_sensor] myIO_hum_Sensor_Driver has been initialized
2023-10-21T13:10:00.189Z [log] [ManagerDrivers] [Driver:myio_imp_sensor] myIO_imp_Sensor_Driver has been initialized
2023-10-21T13:10:00.190Z [log] [ManagerDrivers] [Driver:myio_onoff] myIO_OnOff_Driver has been initialized
2023-10-21T13:10:00.191Z [log] [ManagerDrivers] [Driver:myio_pwm] myIO_PWM_Driver has been initialized
2023-10-21T13:10:00.192Z [log] [ManagerDrivers] [Driver:myio_rgb] myIO_RGB_Driver has been initialized
2023-10-21T13:10:00.192Z [log] [ManagerDrivers] [Driver:myio_temp_sensor] myIO_temp_Sensor_Driver has been initialized

meanwhile, I downgraded the node to node-v16.20.2, and it is working now…
But still I don’t know, why is crashing, on the new homey pro…

on the new homey pro, I add 2 devices, and it uses 10% CPU, and 81,8MB Memory…
on the old (sphere) Homey Pro, I add 125 devices, and the CPU usage is 0.00%, Memory usage is 35,7 MB… with the same app… everything is the same, except the HomePro…

I don’t have any myIO devices so cannot comment on that.

But generally speaking, it looks like for each device you’re creating a 100ms interval to update its capabilities (while the main update loop in app.js only updates every 8 seconds, so I don’t understand the need for 100ms intervals).

Also, you’re “sharing” information between app.js and the individual devices using the Settings manager, which isn’t meant for that. So all the reading and writing to the settings database might be causing issues. Instead, it would be much better to use a standard EventEmitter to pass data around between different parts of your app.

100ms is for fast reacting if the main JSON is changing… It should be anything, but it worked many years ago in this form… The new homey pro has faster CPU, so I don’t think it couse the problem… But I check it… no the problem is not that…
But I found the solution…

var parameters = {
      uri: "http://" + address + ":" + http_port + "/empty",
      setTimeout: 1000,
      json: true,
      headers: {
        'Authorization': 'Basic ' + Buffer.from(username + ":" + password).toString('base64')
      },
      insecureHTTPParser: true  //I had to add this line, to make work the app with the new Homey Pro
    };

The default settings was changed…

1 Like