gadget-monk / homebridge-poolcontroller

Homebridge plugin for Pentair pools
6 stars 4 forks source link

How to install? #2

Closed dkossman closed 4 years ago

dkossman commented 4 years ago

Apologies for the newbie question but how exactly do i install this plugin? i tried the usual "sudo npm install -g homebridge-poolcontroller" and got a Not Found error

also: can you provide an example config.json?

thanks!

gadget-monk commented 4 years ago

I just published the package to npm so maybe try again after some time. Alternatively, you can clone the GitHub repo using the git clone https://github.com/gadget-monk/homebridge-poolcontroller.git command. Once cloned, go the folder where the repo was cloned and use the sudo npm -g install command to install the package. If you use the Homebridge UI (homebridge-config-ui-x), the plugin can be configured directly from the UI. If you want to edit config.json directly, add something like this to to the platform section:

    {
        "ip_address": "http://ip_address:4200",
        "secure": false,
        "skipAllUnInit": true,
        "debug": false,
        "platform": "PoolControllerPlatform"
    }
dkossman commented 4 years ago

thanks. installed the plugin with no errors and added the config.

your example config entry didn't work - it resulted in all of my existing accessories not responding [edit: this was because it caused Homebridge to crash -see subsequent comments]. i ended up adding this to my platforms section, to be consistent with the existing entry for TuyaLan:

     {
            "platform": "PoolControllerPlatform",
            "devices": [
               {
                  "name": "Intelliflo VS Pump",
                  "ip_address": "http://ospi.local:4200",
                  "secure": false,
                  "skipAllUnInit": true,
                  "debug": false
               }
            ]
        }

however I see this in the homebridge logs:

[7/12/2020, 10:59:25 AM] [PoolControllerPlatform] Error retrieving configuration from poolController. Error: Invalid URI "undefined/device"
    at Request.init (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/node_modules/request/request.js:273:31)
    at new Request (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/node_modules/request/request.js:127:8)
    at request (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/node_modules/request/index.js:53:10)
    at PoolControllerPlatform.validateVersion (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/index.js:87:5)
    at PoolControllerPlatform.SSDPDiscovery (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/index.js:77:12)
    at HomebridgeAPI.emit (events.js:194:15)
    at HomebridgeAPI.signalFinished (/opt/nodejs/lib/node_modules/homebridge/src/api.ts:251:10)
    at Server.start (/opt/nodejs/lib/node_modules/homebridge/src/server.ts:160:14)
    at cli (/opt/nodejs/lib/node_modules/homebridge/src/cli.ts:80:10)
    at Object.<anonymous> (/opt/nodejs/lib/node_modules/homebridge/bin/homebridge:17:22)
    at Module._compile (internal/modules/cjs/loader.js:721:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
    at Function.Module._load (internal/modules/cjs/loader.js:552:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:774:12)
dkossman commented 4 years ago

played with this some more.
If i use this config clause in my platforms array, then the pool controller plugin initializes and i can see it talking to the pool controller. However it causes homebridge to crash.


       {
                  "name": "Intelliflo VS Pump",
                  "ip_address": "http://ospi.local:4200",
                  "secure": false,
                  "skipAllUnInit": true,
                  "debug": true,
                  "platform": "PoolControllerPlatform"
        }

log with debug on:

[7/12/2020, 11:33:38 AM] Homebridge is running on port 51826.
[7/12/2020, 11:33:39 AM] [Intelliflo VS Pump] Version checked OK, getting config data
[TuyaDiscovery] UDP from 10.0.1.6:6667 0x000055aa...0x0000aa55
[7/12/2020, 11:33:39 AM] [TuyaLan] Discovered Therapy Room (60077207cc50e3e7647f) identified as Outlet (3.3)
[TuyaAccessory] Changing ping gap for Therapy Room to 9s
[7/12/2020, 11:33:39 AM] [TuyaLan] Connected to Therapy Room
[TuyaAccessory] Sending first query to Therapy Room (3.3)
[TuyaAccessory] Heard back from Therapy Room with command 10
[7/12/2020, 11:33:39 AM] [TuyaLan] Ready to handle Therapy Room (Outlet:3.3) with signature {"1":false,"9":0}
[7/12/2020, 11:33:39 AM] [Intelliflo VS Pump] InitialData:  { time: '2020-07-11T14:49:00.474-0700',
  valve: 0,
  batteryVoltage: 0,
  status:
   { val: 0, name: 'initializing', desc: 'Initializing', percent: 0 },
  mode: { val: 0, name: 'auto', desc: 'Auto' },
  appVersion: '6.0.0',
  circuits: [],
  temps:
   { units: { val: 0, name: 'F', desc: 'Fahrenheit' },
     bodies: [ [Object] ],
     equipmentType: 'temps' },
  equipment:
   { model: 'Virtual Controller',
     maxBodies: 1,
     equipmentType: 'equipment',
     softwareVersion: '',
     bootLoaderVersion: '' },
  pumps:
   [ { id: 1,
       type: [Object],
       status: [Object],
       targetSpeed: 0,
       virtualControllerStatus: [Object],
       command: 4,
       mode: 0,
       driveState: 255,
       watts: 0,
       rpm: 0,
       flow: 55,
       ppc: 44,
       name: 'Intelliflo VS',
       time: 708,
       equipmentType: 'pump',
       minSpeed: 450,
       maxSpeed: 3450,
       speedStepSize: 10,
       circuits: [Array] } ],
  valves: [],
  heaters: [],
  chlorinators: [],
  features:
   [ { id: 7,
       isOn: false,
       name: '450 RPM',
       type: [Object],
       showInFeatures: true,
       equipmentType: 'feature' },
     { id: 8,
       isOn: false,
       name: '1000 RPM',
       type: [Object],
       showInFeatures: true,
       equipmentType: 'feature' },
     { id: 9,
       isOn: false,
       name: '1500 RPM',
       type: [Object],
       showInFeatures: true,
       equipmentType: 'feature' },
     { id: 10,
       isOn: false,
       name: '2000 RPM',
       type: [Object],
       showInFeatures: true,
       equipmentType: 'feature' },
     { id: 11,
       isOn: false,
       name: '2500 RPM',
       type: [Object],
       showInFeatures: true,
       equipmentType: 'feature' },
     { id: 12,
       isOn: false,
       name: '3000 RPM',
       type: [Object],
       showInFeatures: true,
       equipmentType: 'feature' } ],
  circuitGroups: [],
  lightGroups: [],
  virtualCircuits: [],
  covers: [],
  schedules: [],
  chemControllers: [] }
[7/12/2020, 11:33:39 AM] [Intelliflo VS Pump] Using cached circuit accessory: circuitNumber: 7, id: poolController.7.450 RPM
[7/12/2020, 11:33:39 AM] [Intelliflo VS Pump] Using cached circuit accessory: circuitNumber: 8, id: poolController.8.1000 RPM
[7/12/2020, 11:33:39 AM] [Intelliflo VS Pump] Using cached circuit accessory: circuitNumber: 9, id: poolController.9.1500 RPM
[7/12/2020, 11:33:39 AM] [Intelliflo VS Pump] Using cached circuit accessory: circuitNumber: 10, id: poolController.10.2000 RPM
[7/12/2020, 11:33:39 AM] [Intelliflo VS Pump] Using cached circuit accessory: circuitNumber: 11, id: poolController.11.2500 RPM
[7/12/2020, 11:33:39 AM] [Intelliflo VS Pump] Using cached circuit accessory: circuitNumber: 12, id: poolController.12.3000 RPM
[7/12/2020, 11:33:39 AM] [Intelliflo VS Pump] Using cached body: Pool
[7/12/2020, 11:33:50 AM] [Intelliflo VS Pump] Using cached pump: Intelliflo VS
[7/12/2020, 11:33:50 AM] [Intelliflo VS Pump] Updating pump to  false
[7/12/2020, 11:33:50 AM] [Intelliflo VS Pump] watts  0
[7/12/2020, 11:33:50 AM] [Intelliflo VS Pump] RPM %  0
[7/12/2020, 11:33:50 AM] [Intelliflo VS Pump] Flow  55
[7/12/2020, 11:33:50 AM] TypeError: Cannot read property 'val' of undefined
    at PoolControllerAccessory.updateState (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/controllerAccessory.js:61:145)
    at new PoolControllerAccessory (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/controllerAccessory.js:35:10)
    at PoolControllerPlatform.addControllerAccessory (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/index.js:495:30)
    at PoolControllerPlatform.InitialData (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/index.js:248:18)
    at Request._callback (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/index.js:120:26)
    at Request.self.callback (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/node_modules/request/request.js:185:22)
    at Request.emit (events.js:189:13)
    at Request.<anonymous> (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/node_modules/request/request.js:1154:10)
    at Request.emit (events.js:189:13)
    at IncomingMessage.<anonymous> (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/node_modules/request/request.js:1076:12)
    at Object.onceWrapper (events.js:277:13)
    at IncomingMessage.emit (events.js:194:15)
    at endReadableNT (_stream_readable.js:1129:12)
    at process.internalTickCallback (internal/process/next_tick.js:72:19)
[TuyaDiscovery] UDP from 10.0.1.3:6667 0x000055aa...0x0000aa55
[7/12/2020, 11:33:51 AM] [TuyaLan] Discovered Porch Lights (60077207cc50e3e7fe1d) identified as Outlet (3.3)
[TuyaAccessory] Changing ping gap for Porch Lights to 9s
[TuyaDiscovery] UDP from 10.0.1.15:6667 0x000055aa...0x0000aa55
[7/12/2020, 11:33:51 AM] [TuyaLan] Discovered Studio Light (15010212ecfabcb682ab) identified as Outlet (3.3)
[TuyaAccessory] Changing ping gap for Studio Light to 9s
[TuyaDiscovery] UDP from 10.0.1.21:6667 0x000055aa...0x0000aa55
[7/12/2020, 11:33:51 AM] [TuyaLan] Discovered Master Bedroom Light (400445462cf43216184d) identified as Outlet (3.3)
[TuyaAccessory] Changing ping gap for Master Bedroom Light to 9s
[TuyaDiscovery] UDP from 10.0.1.3:6667 0x000055aa...0x0000aa55
[TuyaDiscovery] UDP from 10.0.1.15:6667 0x000055aa...0x0000aa55
[TuyaDiscovery] UDP from 10.0.1.21:6667 0x000055aa...0x0000aa55
[TuyaDiscovery] UDP from 10.0.1.3:6667 0x000055aa...0x0000aa55
[7/12/2020, 11:33:51 AM] Got SIGTERM, shutting down Homebridge...
[7/12/2020, 11:33:51 AM] [TuyaLan] Connected to Porch Lights
[TuyaAccessory] Sending first query to Porch Lights (3.3)
[7/12/2020, 11:33:51 AM] [TuyaLan] Connected to Studio Light
[TuyaAccessory] Sending first query to Studio Light (3.3)
[7/12/2020, 11:33:51 AM] [TuyaLan] Connected to Master Bedroom Light
[TuyaAccessory] Sending first query to Master Bedroom Light (3.3)
[TuyaAccessory] Heard back from Porch Lights with command 10
[7/12/2020, 11:33:51 AM] [TuyaLan] Ready to handle Porch Lights (Outlet:3.3) with signature {"1":false,"9":0}
[TuyaAccessory] Heard back from Master Bedroom Light with command 10
[7/12/2020, 11:33:51 AM] [TuyaLan] Ready to handle Master Bedroom Light (Outlet:3.3) with signature {"1":false,"101":0}
[TuyaAccessory] Heard back from Studio Light with command 10
[7/12/2020, 11:33:51 AM] [TuyaLan] Ready to handle Studio Light (Outlet:3.3) with signature {"1":false,"101":0}
homebridge.service: Main process exited, code=exited, status=143/n/a
homebridge.service: Failed with result 'exit-code'.

the root cause seems to be

[7/12/2020, 11:33:50 AM] TypeError: Cannot read property 'val' of undefined
at PoolControllerAccessory.updateState (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/controllerAccessory.js:61:145)
gadget-monk commented 4 years ago

Thanks, I haven't had a chance to test on virtual controllers. It seems like delays are not applicable on virtual controllers. I just pushed a fix, can you try again? I also noticed in the logs that your pump reports 55gpm flow even though its not running (RPM =0). I wonder if that's something you need to look into on the nodejs-poolController side with tag.

dkossman commented 4 years ago

thanks - crashes with different error now (do i need to do any cleanup after updating the plugin?):

[7/12/2020, 3:37:57 PM] [Intelliflo VS Pump] InitialData:  { time: '2020-07-12T15:37:00.396-0700',
  valve: 0,
  batteryVoltage: 0,
  status: { val: 1, name: 'ready', desc: 'Ready', percent: 100 },
  mode: { val: 0, name: 'auto', desc: 'Auto' },
  appVersion: '6.0.0',
  circuits:
   [ { id: 6,
       name: 'Pool',
       type: [Object],
       isOn: true,
       equipmentType: 'circuit' } ],
  temps:
   { units: { val: 0, name: 'F', desc: 'Fahrenheit' },
     bodies: [ [Object] ],
     equipmentType: 'temps' },
  equipment:
   { controllerType: 'virtual',
     model: 'Virtual Controller',
     maxBodies: 1,
     equipmentType: 'equipment',
     softwareVersion: '',
     bootLoaderVersion: '' },
  pumps:
   [ { id: 1,
       type: [Object],
       status: [Object],
       targetSpeed: 750,
       virtualControllerStatus: [Object],
       command: 10,
       mode: 9,
       driveState: 1,
       watts: 39,
       rpm: 750,
       flow: 55,
       ppc: 44,
       name: 'Intelliflo VS',
       time: 938,
       equipmentType: 'pump',
       minSpeed: 450,
       maxSpeed: 3450,
       speedStepSize: 10,
       circuits: [Array] } ],
  valves: [],
  heaters: [],
  chlorinators: [],
  features:
   [ { id: 7,
       isOn: true,
       name: 'Pump 750 RPM',
       type: [Object],
       showInFeatures: true,
       equipmentType: 'feature' },
     { id: 8,
       isOn: false,
       name: 'Pump 1500 RPM',
       type: [Object],
       showInFeatures: true,
       equipmentType: 'feature' },
     { id: 9,
       isOn: false,
       name: 'Pump 2500 RPM',
       type: [Object],
       showInFeatures: true,
       equipmentType: 'feature' },
     { id: 10,
       isOn: false,
       name: 'Pump 3000 RPM',
       type: [Object],
       showInFeatures: true,
       equipmentType: 'feature' } ],
  circuitGroups: [],
  lightGroups: [],
  virtualCircuits: [],
  covers: [],
  schedules: [],
  chemControllers: [] }
[7/12/2020, 3:37:58 PM] [Intelliflo VS Pump] Creating new circuit accessory: circuitNumber: 6, id: poolController.6.Pool
[7/12/2020, 3:37:58 PM] [Intelliflo VS Pump] Creating new circuit accessory: circuitNumber: 7, id: poolController.7.Pump 750 RPM
[7/12/2020, 3:37:58 PM] [Intelliflo VS Pump] Creating new circuit accessory: circuitNumber: 8, id: poolController.8.Pump 1500 RPM
[7/12/2020, 3:37:58 PM] [Intelliflo VS Pump] Creating new circuit accessory: circuitNumber: 9, id: poolController.9.Pump 2500 RPM
[7/12/2020, 3:37:58 PM] [Intelliflo VS Pump] Creating new circuit accessory: circuitNumber: 10, id: poolController.10.Pump 3000 RPM
[7/12/2020, 3:37:59 PM] [Intelliflo VS Pump] Using cached body: Pool
[7/12/2020, 3:38:09 PM] TypeError: accessory.getService is not a function
    at new PoolBodyAccessory (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/bodyAccessory.js:26:28)
    at PoolControllerPlatform.InitialData (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/index.js:212:42)
    at Request._callback (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/index.js:120:26)
    at Request.self.callback (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/node_modules/request/request.js:185:22)
    at Request.emit (events.js:189:13)
    at Request.<anonymous> (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/node_modules/request/request.js:1154:10)
    at Request.emit (events.js:189:13)
    at IncomingMessage.<anonymous> (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/node_modules/request/request.js:1076:12)
    at Object.onceWrapper (events.js:277:13)
    at IncomingMessage.emit (events.js:194:15)
    at endReadableNT (_stream_readable.js:1129:12)
    at process.internalTickCallback (internal/process/next_tick.js:72:19)
[TuyaDiscovery] UDP from 10.0.1.6:6667 0x000055aa...0x0000aa55
[7/12/2020, 3:38:09 PM] [TuyaLan] Discovered Therapy Room (60077207cc50e3e7647f) identified as Outlet (3.3)
[TuyaAccessory] Changing ping gap for Therapy Room to 9s
[TuyaDiscovery] UDP from 10.0.1.6:6667 0x000055aa...0x0000aa55
[TuyaDiscovery] UDP from 10.0.1.6:6667 0x000055aa...0x0000aa55
[7/12/2020, 3:38:09 PM] Got SIGTERM, shutting down Homebridge...
[7/12/2020, 3:38:09 PM] [TuyaLan] Connected to Therapy Room
[TuyaAccessory] Sending first query to Therapy Room (3.3)
[TuyaAccessory] Heard back from Therapy Room with command 10
[7/12/2020, 3:38:09 PM] [TuyaLan] Ready to handle Therapy Room (Outlet:3.3) with signature {"1":false,"9":0}
homebridge.service: Main process exited, code=exited, status=143/n/a
homebridge.service: Failed with result 'exit-code'.
homebridge.service: Service RestartSec=10s expired, scheduling restart.
gadget-monk commented 4 years ago

It seems like the bodies object may also be different (or completely missing) on virtual controllers. Can you please copy the output of http://ip_address:4200/state/all into a text file and attach here (replace ip_address with the hostname or IP address of the nodejs-poolController machine.

dkossman commented 4 years ago
{
  "time": "2020-07-12T15:46:00.411-0700",
  "valve": 0,
  "batteryVoltage": 0,
  "status": {
    "val": 0,
    "name": "initializing",
    "desc": "Initializing",
    "percent": 0
  },
  "mode": {
    "val": 0,
    "name": "auto",
    "desc": "Auto"
  },
  "appVersion": "6.0.0",
  "circuits": [
    {
      "id": 6,
      "name": "Pool",
      "type": {
        "val": 6,
        "name": "generic",
        "desc": "Generic"
      },
      "isOn": false,
      "equipmentType": "circuit"
    }
  ],
  "temps": {
    "units": {
      "val": 0,
      "name": "F",
      "desc": "Fahrenheit"
    },
    "bodies": [
      {
        "id": 1,
        "heatMode": {
          "val": 0
        },
        "name": "Pool",
        "circuit": 6,
        "heatStatus": {
          "val": 0,
          "name": "off",
          "desc": "Off"
        },
        "isOn": false
      }
    ],
    "equipmentType": "temps"
  },
  "equipment": {
    "model": "Virtual Controller",
    "maxBodies": 1,
    "equipmentType": "equipment",
    "softwareVersion": "",
    "bootLoaderVersion": ""
  },
  "pumps": [
    {
      "id": 1,
      "type": {
        "val": 128,
        "name": "vs",
        "desc": "Intelliflo VS",
        "maxPrimingTime": 6,
        "minSpeed": 450,
        "maxSpeed": 3450,
        "speedStepSize": 10,
        "maxCircuits": 8,
        "hasAddress": true
      },
      "status": {
        "name": "off",
        "desc": "Off",
        "val": 0
      },
      "targetSpeed": 0,
      "virtualControllerStatus": {
        "val": 1,
        "name": "running",
        "desc": "Running"
      },
      "command": 4,
      "mode": 0,
      "driveState": 255,
      "watts": 0,
      "rpm": 0,
      "flow": 55,
      "ppc": 44,
      "name": "Intelliflo VS",
      "time": 1014,
      "equipmentType": "pump",
      "minSpeed": 450,
      "maxSpeed": 3450,
      "speedStepSize": 10,
      "circuits": [
        {
          "id": 1,
          "circuit": {
            "id": 7,
            "isOn": false,
            "name": "Pump 750 RPM",
            "type": {
              "val": 0,
              "name": "generic",
              "desc": "Generic"
            },
            "showInFeatures": true,
            "equipmentType": "feature"
          },
          "units": {
            "val": 0,
            "name": "rpm",
            "desc": "RPM"
          },
          "speed": 750
        },
        {
          "id": 2,
          "circuit": {
            "id": 8,
            "isOn": false,
            "name": "Pump 1500 RPM",
            "type": {
              "val": 0,
              "name": "generic",
              "desc": "Generic"
            },
            "showInFeatures": true,
            "equipmentType": "feature"
          },
          "units": {
            "val": 0,
            "name": "rpm",
            "desc": "RPM"
          },
          "speed": 1500
        },
        {
          "id": 3,
          "circuit": {
            "id": 9,
            "isOn": false,
            "name": "Pump 2500 RPM",
            "type": {
              "val": 0,
              "name": "generic",
              "desc": "Generic"
            },
            "showInFeatures": true,
            "equipmentType": "feature"
          },
          "units": {
            "val": 0,
            "name": "rpm",
            "desc": "RPM"
          },
          "speed": 2500
        },
        {
          "id": 4,
          "circuit": {
            "id": 10,
            "isOn": false,
            "name": "Pump 3000 RPM",
            "type": {
              "val": 0,
              "name": "generic",
              "desc": "Generic"
            },
            "showInFeatures": true,
            "equipmentType": "feature"
          },
          "units": {
            "val": 0,
            "name": "rpm",
            "desc": "RPM"
          },
          "speed": 3000
        },
        {
          "id": 5,
          "circuit": {
            "equipmentType": "circuit",
            "id": 0,
            "name": "Not Used",
            "speed": 0
          },
          "units": {
            "val": 0,
            "name": "rpm",
            "desc": "RPM"
          }
        },
        {
          "id": 6,
          "circuit": {
            "equipmentType": "circuit",
            "id": 0,
            "name": "Not Used",
            "speed": 0
          },
          "units": {
            "val": 0,
            "name": "rpm",
            "desc": "RPM"
          }
        },
        {
          "id": 7,
          "circuit": {
            "equipmentType": "circuit",
            "id": 0,
            "name": "Not Used",
            "speed": 0
          },
          "units": {
            "val": 0,
            "name": "rpm",
            "desc": "RPM"
          }
        },
        {
          "id": 8,
          "circuit": {
            "equipmentType": "circuit",
            "id": 0,
            "name": "Not Used",
            "speed": 0
          },
          "units": {
            "val": 0,
            "name": "rpm",
            "desc": "RPM"
          }
        }
      ]
    }
  ],
  "valves": [],
  "heaters": [],
  "chlorinators": [],
  "features": [
    {
      "id": 7,
      "isOn": false,
      "name": "Pump 750 RPM",
      "type": {
        "val": 0,
        "name": "generic",
        "desc": "Generic"
      },
      "showInFeatures": true,
      "equipmentType": "feature"
    },
    {
      "id": 8,
      "isOn": false,
      "name": "Pump 1500 RPM",
      "type": {
        "val": 0,
        "name": "generic",
        "desc": "Generic"
      },
      "showInFeatures": true,
      "equipmentType": "feature"
    },
    {
      "id": 9,
      "isOn": false,
      "name": "Pump 2500 RPM",
      "type": {
        "val": 0,
        "name": "generic",
        "desc": "Generic"
      },
      "showInFeatures": true,
      "equipmentType": "feature"
    },
    {
      "id": 10,
      "isOn": false,
      "name": "Pump 3000 RPM",
      "type": {
        "val": 0,
        "name": "generic",
        "desc": "Generic"
      },
      "showInFeatures": true,
      "equipmentType": "feature"
    }
  ],
  "circuitGroups": [],
  "lightGroups": [],
  "virtualCircuits": [],
  "covers": [],
  "schedules": [],
  "chemControllers": []
}
gadget-monk commented 4 years ago

I think I figured out what happened but before I update the code, can you please try the following:

Remove the plugin entry from config.json; Restart homebridge with the plugin still installed to clean cached accessories; Uninstall the plugin; Restart homebridge again and reinstall the plugin Add the plugin entry back into config.json and restart

During the entire time please ensure nodes-PoolController stays running.

dkossman commented 4 years ago

thanks for your help with this. Just ran through those steps - same result as last time :

[7/12/2020, 8:46:31 PM] TypeError: accessory.getService is not a function
    at new PoolBodyAccessory (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/bodyAccessory.js:26:28)
    at PoolControllerPlatform.InitialData (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/index.js:212:42)
    at Request._callback (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/index.js:120:26)
    at Request.self.callback (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/node_modules/request/request.js:185:22)
    at Request.emit (events.js:189:13)
    at Request.<anonymous> (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/node_modules/request/request.js:1154:10)
    at Request.emit (events.js:189:13)
    at IncomingMessage.<anonymous> (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/node_modules/request/request.js:1076:12)
    at Object.onceWrapper (events.js:277:13)
    at IncomingMessage.emit (events.js:194:15)
    at endReadableNT (_stream_readable.js:1129:12)
    at process.internalTickCallback (internal/process/next_tick.js:72:19)
gadget-monk commented 4 years ago

That's strange, the cached accessories are still there. Do you remember seeing any entries like this in the log when you restarted after deleting the plugin:

Failed to find plugin to handle accessory Pool Removing orphaned accessory Pool

Also, right before this error, do you see the plugin creating a new body accessory called or pool or using a cached accessory?

dkossman commented 4 years ago

i got that message yesterday morning, but that was when i had the incorrect entry in config.json (see my second comment in this issue). i didn't see it after that.

Homebridge log after reinstalling the plugin and removing the poolcontroller config entry. Homebridge seems to have cached the config entries. When i restarted it one more time after the log shown below, the "Failed to find plugin to handle accessory Pool" and "Removing orphaned accessory Pool" etc. etc. messages were gone.

Started Node.js HomeKit Server.
[7/12/2020, 8:49:46 PM] Loaded config.json with 15 accessories and 1 platforms.
[7/12/2020, 8:49:46 PM] ---
[7/12/2020, 8:49:56 PM] Loaded plugin: homebridge-http-switch@0.5.30
[7/12/2020, 8:49:57 PM] Registering accessory 'homebridge-http-switch.HTTP-SWITCH'
[7/12/2020, 8:49:57 PM] ---
[7/12/2020, 8:49:59 PM] Loaded plugin: homebridge-http-temperature@0.7.0
[7/12/2020, 8:49:59 PM] Registering accessory 'homebridge-http-temperature.HttpTemperature'
[7/12/2020, 8:49:59 PM] ---
[7/12/2020, 8:50:00 PM] Loaded plugin: homebridge-poolcontroller@3.0.1
[7/12/2020, 8:50:00 PM] Registering platform 'homebridge-poolcontroller.PoolControllerPlatform'
[7/12/2020, 8:50:00 PM] ---
[7/12/2020, 8:50:00 PM] Loaded plugin: homebridge-tuya@1.0.0
[7/12/2020, 8:50:00 PM] Registering platform 'homebridge-tuya.TuyaLan'
[7/12/2020, 8:50:01 PM] ---
[7/12/2020, 8:50:01 PM] Loaded plugin: homebridge-twilio-sms@0.0.2
[7/12/2020, 8:50:01 PM] Registering accessory 'homebridge-twilio-sms.Twilio'
[7/12/2020, 8:50:01 PM] ---
[7/12/2020, 8:50:01 PM] Loading 1 platforms...
[7/12/2020, 8:50:01 PM] [TuyaLan] Initializing TuyaLan platform...
[7/12/2020, 8:50:01 PM] Loading 15 accessories...
[7/12/2020, 8:50:01 PM] [Lamp 1] Initializing HTTP-SWITCH accessory...
[7/12/2020, 8:50:01 PM] [Lamp 1] Switch successfully configured...
[7/12/2020, 8:50:01 PM] [Lamp 2] Initializing HTTP-SWITCH accessory...
[7/12/2020, 8:50:01 PM] [Lamp 2] Switch successfully configured...
[7/12/2020, 8:50:01 PM] [Filter] Initializing HTTP-SWITCH accessory...
[7/12/2020, 8:50:01 PM] [Filter] Switch successfully configured...
[7/12/2020, 8:50:01 PM] [Feeder] Initializing HTTP-SWITCH accessory...
[7/12/2020, 8:50:01 PM] [Feeder] Switch successfully configured...
[7/12/2020, 8:50:01 PM] [Yard Lights] Initializing HTTP-SWITCH accessory...
[7/12/2020, 8:50:01 PM] [Yard Lights] Switch successfully configured...
[7/12/2020, 8:50:01 PM] [Fountain] Initializing HTTP-SWITCH accessory...
[7/12/2020, 8:50:01 PM] [Fountain] Switch successfully configured...
[7/12/2020, 8:50:01 PM] [Spa Valves] Initializing HTTP-SWITCH accessory...
[7/12/2020, 8:50:01 PM] [Spa Valves] Switch successfully configured...
[7/12/2020, 8:50:01 PM] [Heater] Initializing HTTP-SWITCH accessory...
[7/12/2020, 8:50:01 PM] [Heater] Switch successfully configured...
[7/12/2020, 8:50:01 PM] [Blower] Initializing HTTP-SWITCH accessory...
[7/12/2020, 8:50:01 PM] [Blower] Switch successfully configured...
[7/12/2020, 8:50:01 PM] [Cover] Initializing HTTP-SWITCH accessory...
[7/12/2020, 8:50:01 PM] [Cover] Switch successfully configured...
[7/12/2020, 8:50:01 PM] [Temperature] Initializing HttpTemperature accessory...
[7/12/2020, 8:50:01 PM] [Pool Temperature] Initializing HttpTemperature accessory...
[7/12/2020, 8:50:01 PM] [Spa Temperature] Initializing HttpTemperature accessory...
[7/12/2020, 8:50:01 PM] [SMS Spa] Initializing Twilio accessory...
[7/12/2020, 8:50:10 PM] [SMS Aquarium] Initializing Twilio accessory...
[7/12/2020, 8:50:10 PM] [TuyaLan] Marked Studio Light unreachable by faulting Service.Studio Light.On
[7/12/2020, 8:50:10 PM] [TuyaLan] Marked Porch Lights unreachable by faulting Service.Porch Lights.On
[7/12/2020, 8:50:10 PM] [TuyaLan] Marked Master Bedroom Light unreachable by faulting Service.Master Bedroom Light.On
[7/12/2020, 8:50:10 PM] [TuyaLan] Marked Therapy Room unreachable by faulting Service.Therapy Room.On
[7/12/2020, 8:50:10 PM] Failed to find plugin to handle accessory Pool
[7/12/2020, 8:50:10 PM] Removing orphaned accessory Pool
[7/12/2020, 8:50:10 PM] Failed to find plugin to handle accessory Pump 750 RPM
[7/12/2020, 8:50:10 PM] Removing orphaned accessory Pump 750 RPM
[7/12/2020, 8:50:10 PM] Failed to find plugin to handle accessory Pump 1500 RPM
[7/12/2020, 8:50:10 PM] Removing orphaned accessory Pump 1500 RPM
[7/12/2020, 8:50:10 PM] Failed to find plugin to handle accessory Pump 2500 RPM
[7/12/2020, 8:50:10 PM] Removing orphaned accessory Pump 2500 RPM
[7/12/2020, 8:50:10 PM] Failed to find plugin to handle accessory Pump 3000 RPM
[7/12/2020, 8:50:10 PM] Removing orphaned accessory Pump 3000 RPM
[7/12/2020, 8:50:10 PM] [TuyaLan] Starting discovery...
[TuyaDiscovery] Discovery started on port 6666.
[TuyaDiscovery] Discovery started on port 6667.
Setup Payload:
X-HM://0023ISYWYI5KD
Scan this code with your HomeKit app on your iOS device to pair with Homebridge:

Or enter this code with your HomeKit app on your iOS device to pair with Homebridge:

    ┌────────────┐
    │ xxxxxxxxxx │
    └────────────┘

[7/12/2020, 8:50:12 PM] Homebridge is running on port 51826.
gadget-monk commented 4 years ago

I couldn't reproduce the error so I pushed a new version with better debug reporting. Can you please try updating the new version and paste information from the logs? I am interested in the lines immediately after: [PoolControllerPlatform] Processing Body - poolController.6.1.Pool and anything between the lines ---Diagnostic data on cached accessory--- and ---End Diagnostic Data---

Thanks!

dkossman commented 4 years ago

i updated the plugin, config.json contains

        {
            "ip_address": "http://ospi.local:4200",
            "secure": false,
            "skipAllUnInit": true,
            "debug": true,
            "platform": "PoolControllerPlatform"
        }                 

Homebridge log:

[7/14/2020, 9:50:17 AM] Homebridge is running on port 51826.

...

[7/14/2020, 9:50:23 AM] [PoolControllerPlatform] Version checked OK, getting config data
[7/14/2020, 9:50:23 AM] [PoolControllerPlatform] Executing request - server: http://ospi.local:4200, command: getAll, data: undefined
[7/14/2020, 9:50:23 AM] [PoolControllerPlatform] Sending command to pool controller server:  { method: 'get',
  data: undefined,
  url: 'http://ospi.local:4200/state/all' }
[7/14/2020, 9:50:23 AM] [PoolControllerPlatform] Pool controller not ready, retrying...
[7/14/2020, 9:50:28 AM] [PoolControllerPlatform] Version checked OK, getting config data
[7/14/2020, 9:50:28 AM] [PoolControllerPlatform] Executing request - server: http://ospi.local:4200, command: getAll, data: undefined
[7/14/2020, 9:50:28 AM] [PoolControllerPlatform] Sending command to pool controller server:  { method: 'get',
  data: undefined,
  url: 'http://ospi.local:4200/state/all' }
[7/14/2020, 9:50:28 AM] [PoolControllerPlatform] Pool controller not ready, retrying...
[7/14/2020, 9:50:33 AM] [PoolControllerPlatform] Version checked OK, getting config data
[7/14/2020, 9:50:33 AM] [PoolControllerPlatform] Executing request - server: http://ospi.local:4200, command: getAll, data: undefined
[7/14/2020, 9:50:33 AM] [PoolControllerPlatform] Sending command to pool controller server:  { method: 'get',
  data: undefined,
  url: 'http://ospi.local:4200/state/all' }
[7/14/2020, 9:50:34 AM] [PoolControllerPlatform] Pool controller not ready, retrying...

I see messages in poolController console:

pi@ospi:~/nodejs-poolController $ node dist/app.js
Init state for Pool Controller
info: Starting up SSDP server
info: Server is now listening on 0.0.0.0:4200
info: Serial port: /dev/ttyUSB0 opened
info: Serial port: /dev/ttyUSB0 request to open succeeded without error
info: New socket client connected L4Uh2UXQ2wd9uFmqAAAA -- 10.0.1.43
info: Starting Virtual Pump Controller: Pump 1
10.0.1.53 GET /state/all {}
10.0.1.53 GET /state/all {}
10.0.1.53 GET /state/all {}
10.0.1.53 GET /state/all {}
gadget-monk commented 4 years ago

Do you have the webClient for poolController? Can you confirm that it is reporting controller status as Ready: 100%? It can take 7.5s with an internal controller to switch to "Ready" status.

gadget-monk commented 4 years ago

Also, it may be easier to try and troubleshoot over an IM session so I can make live changes and try it out instead of pushing out a new release each time. Let me know if this works for you. I am in pacific time zone.

dkossman commented 4 years ago

i do have the web client. i have been seeing problems - the client works, i can control the pump, but the client does not report Ready 100% and it shows Off when its running. Not sure why. Screenshot attached. When i turn on one of the features, i see it correctly report "Priming" but after that it shows Off, even though in fact its running at the reported speed.

If i delete the json files in the njspc data folder and restart, it corrects the system status to 100%, but after i restart njspc it reverts to 0%.

Screen Shot 2020-07-14 at Jul 14, 2020  10 54 54 AM
gadget-monk commented 4 years ago

I can disable that check and see if that works, in parallel it might be a good idea to ask tagyourit about the controller and pump state

dkossman commented 4 years ago

thanks. Will do. I don't really understand what the Bodies section is for - it doesn't seem to make any difference to the operation of the pump. I have no other equipment - just the VS pump.

gadget-monk commented 4 years ago

Actually that makes sense, bodies is only applicable if you have a controller because it creates a thermostat service along with the on/off functions. For a virtual controller it doesn't make sense and all you need is an on/off switch. Can you try the version I just added? Also, add these lines to config.json between the debug and platform lines: "setupBodyAsCircuit": true, "IgnoreControllerReadyState": true,

The first option will create bodies as normal circuits (on/off button) and the second option disables checking of Controller Ready state.

dkossman commented 4 years ago

OK - installed new version and updated the config. Definite progress! now i see 5 new accessories in the Home app (all switches): the Pool and the 4 features. The good news: As i set each feature to On, the pump runs at that speed. The bad news: the plugin does not seem to be correctly fetching On/Off status from the server. i.e. if i refresh the room in the Home app, the switch i just set to On goes back to Off state, even though the pump is still running at that speed. I'll attach the Homebridge log. Note that there is still an exception, but it doesn't crash Homebridge:

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'val' of undefined
    at PoolControllerAccessory.updateState (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/controllerAccessory.js:60:31)

pc-log.txt

gadget-monk commented 4 years ago

finally some progress! Does the circuit state sync correctly on the poolController side (e.g. when you check -webClient are the circuit states accurate?)

With debug enabled, do you see log entries starting with FROM CIRCUIT CLIENT:

Off topic, but in addition to the 5 switches, you should also see a fan accessory (representing the pump).

dkossman commented 4 years ago

sorry - must be blind - didn't previously notice the Fan accessory, but it is there. Didn't try using that, will test tomorrow. The log is attached to my previous comment - I don't see any entries starting with FROM CIRCUIT CLIENT - unless these would be generated byusing the fan control? config.json entry is:

        {
            "ip_address": "http://ospi.local:4200",
            "secure": false,
            "skipAllUnInit": true,
            "debug": true,
            "setupBodyAsCircuit": true,
            "IgnoreControllerReadyState": true,
            "platform": "PoolControllerPlatform"
        }
gadget-monk commented 4 years ago

The fan is read-only - in the normal iOS Home app it will show pump speed as a % (current RPM/max RPM). If you use the EVE app (free in App Store), it will show other stats like power consumption and cost.

If there are no entries with FROM CIRCUIT CLIENT, I think poolController is not sending emits via the socket client for state changes. I will ping tagyourit.

gadget-monk commented 4 years ago

Looks like there was an commit to poolController to fix this issue. Can you update the server and try again?

dkossman commented 4 years ago

installed the njspc update - now the pump no longer turns off when i turn the Home accessory switches off. The switch state on the home app changes to off when i turn it off. However it does not stay on when the switch is on, e.g. if i refresh the room or restart the Home app. this is the log from turning on and off the 750 and then the 1500 switch:

[7/15/2020, 8:13:55 AM] [PoolControllerPlatform] Setting Circuit Pool to true  from  false
[7/15/2020, 8:13:55 AM] [PoolControllerPlatform] Executing request - server: http://ospi.local:4200, command: toggleCircuit, data: { id: 6 }
[7/15/2020, 8:13:55 AM] [PoolControllerPlatform] Sending command to pool controller server:  { method: 'put',
  data: { id: 6 },
  url: 'http://ospi.local:4200/state/circuit/toggleState' }
[7/15/2020, 8:14:01 AM] [PoolControllerPlatform] Setting Circuit Pump 750 RPM to true  from  false
[7/15/2020, 8:14:01 AM] [PoolControllerPlatform] Executing request - server: http://ospi.local:4200, command: toggleCircuit, data: { id: 7 }
[7/15/2020, 8:14:01 AM] [PoolControllerPlatform] Sending command to pool controller server:  { method: 'put',
  data: { id: 7 },
  url: 'http://ospi.local:4200/state/circuit/toggleState' }
[7/15/2020, 8:15:18 AM] [PoolControllerPlatform] Setting Circuit Pump 750 RPM to false  from  false
[7/15/2020, 8:16:32 AM] [PoolControllerPlatform] Setting Circuit Pump 1500 RPM to true  from  false
[7/15/2020, 8:16:32 AM] [PoolControllerPlatform] Executing request - server: http://ospi.local:4200, command: toggleCircuit, data: { id: 8 }
[7/15/2020, 8:16:32 AM] [PoolControllerPlatform] Sending command to pool controller server:  { method: 'put',
  data: { id: 8 },
  url: 'http://ospi.local:4200/state/circuit/toggleState' }
[7/15/2020, 8:16:51 AM] [Temperature] Call to getState: waiting_response is "false"
[7/15/2020, 8:16:51 AM] [Temperature] Requesting temperature on "http://10.0.1.45/last_read.php?option=Temp", method GET
[7/15/2020, 8:16:51 AM] [Temperature] HTTP successful response: 27.6611
[7/15/2020, 8:17:11 AM] [PoolControllerPlatform] Setting Circuit Pump 1500 RPM to false  from  false

here is the log when i turn on and then off the Pool switch on the Home app:

[7/15/2020, 8:49:51 AM] [PoolControllerPlatform] Setting Circuit Pool to true  from  false
[7/15/2020, 8:49:51 AM] [PoolControllerPlatform] Executing request - server: http://ospi.local:4200, command: toggleCircuit, data: { id: 6 }
[7/15/2020, 8:49:51 AM] [PoolControllerPlatform] Sending command to pool controller server:  { method: 'put',
  data: { id: 6 },
  url: 'http://ospi.local:4200/state/circuit/toggleState' }
[7/15/2020, 8:50:20 AM] [PoolControllerPlatform] Setting Circuit Pool to false  from  false

Probably unrelated, but I'm seeing the following in the njspc log when i turn off a switch in the webapp: (but the operations work):

10.0.1.43 PUT /state/circuit/toggleState {"id":"7"}
warn: Message aborted after 2 attempt(s): 165,0,96,33,1,4,2,196,0,0,1,241
error: Message aborted after 2 attempt(s): 165,0,96,33,1,4,2,196,0,0,1,241 {"code":501,"httpCode":400,"position":{"column":27,"line":260,"dir":"/home/pi/nodejs-poolController/controller/comms","file":"Comms.ts"},"name":"OutboundMessageError","msg":{"_complete":false,"_id":2667,"timestamp":"2020-07-15T15:28:15.998Z","direction":"out","protocol":"pump","padding":[],"preamble":[255,0,255],"header":[165,0,96,33,1,4],"payload":[2,196,0,0],"term":[1,241],"packetCount":0,"isValid":true,"retries":1,"tries":2,"failed":true}}
gadget-monk commented 4 years ago

It seems like the pool and feature circuit on/off state seems to follow the buttons you are pressing. Can you try the same actions in webClient and see if the results are different?

dkossman commented 4 years ago

The web client works as expected. The buttons always correctly reflect the state of the feature switches. this is true whether i turn on or off the feature switch from Homebridge or the web client.

However, the homebridge plugin and Home app does not correctly reflect the actual state of the pump or the feature switches. To reproduce:

scenario a:
initial condition: turn off all feature switches. verify that pump is off.

  1. turn on a feature switch from web client
  2. verify that pump is running at expected speed
  3. verify that web client reflects the switch state and pump speed
  4. start home app and check switches expected: switch is shown as On actual: switch is shown as Off
  5. check Fan control in Home app expected: shows current speed actual: shows Off

scenario b: initial condition: turn off all feature switches. verify that pump is off.

  1. turn on a switch from the Home app
  2. verify that pump is running at expected speed
  3. verify that web client reflects the switch states
  4. verify switch state in Home app expected: switch is shown as On actual: switch initially is On but is shown as Off once Home app refreshes
  5. check Fan control in Home app expected: shows current speed actual: shows Off
gadget-monk commented 4 years ago

Got it, so the state is not syncing between the server and the plugin. With debug=true in the plugin, are you able to see FROM CIRCUIT CLIENT messages in the homebridge log? Also, confirm that the latest version of njspc is installed.

dkossman commented 4 years ago

there are no "from circuit client" messages in the homebridge log. i updated njscp yesterday after you mentioned that there had been a commit.

the things i notice in the log are this message during startup:

(node:32395) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'val' of undefined
    at PoolControllerAccessory.updateState (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/controllerAccessory.js:60:31)

and messages about setting the circuit from false to false, e.g.

[7/14/2020, 7:58:12 PM] [PoolControllerPlatform] Setting Circuit Pump 750 RPM to true  from  false
[7/14/2020, 7:58:12 PM] [PoolControllerPlatform] Executing request - server: http://ospi.local:4200, command: toggleCircuit, data: { id: 7 }
[7/14/2020, 7:58:12 PM] [PoolControllerPlatform] Sending command to pool controller server:  { method: 'put',
  data: { id: 7 },
  url: 'http://ospi.local:4200/state/circuit/toggleState' }
[7/14/2020, 7:58:18 PM] [PoolControllerPlatform] Setting Circuit Pump 1500 RPM to false  from  false
[7/14/2020, 7:58:19 PM] [PoolControllerPlatform] Setting Circuit Pump 750 RPM to true  from  false
[7/14/2020, 7:58:19 PM] [PoolControllerPlatform] Executing request - server: http://ospi.local:4200, command: toggleCircuit, data: { id: 7 }
[7/14/2020, 7:58:19 PM] [PoolControllerPlatform] Sending command to pool controller server:  { method: 'put',
  data: { id: 7 },
  url: 'http://ospi.local:4200/state/circuit/toggleState' }

thanks again for your support.

gadget-monk commented 4 years ago

There was another update to njspc today that should fix this.

dkossman commented 4 years ago

thanks. ran a git pull and then npm start. Also updated the homebridge plugin. But still have the same issue. for the web client, when i turn off and on a virtual circuit (feature), i see state toggle messages in the njspc log. e.g. this is turning on the 750 switch, then 1500, then turning off 1500 and then 750:

10.0.1.8 PUT /state/circuit/toggleState {"id":"7"}
10.0.1.8 PUT /state/circuit/toggleState {"id":"8"}
10.0.1.8 PUT /state/circuit/toggleState {"id":"8"}
10.0.1.8 PUT /state/circuit/toggleState {"id":"7"}

However when i use the Home app to do this, I only see the "on" toggles. nothing when i turn off the switch. and in the Homebridge log i see:

[7/16/2020, 4:15:29 PM] [PoolControllerPlatform] Setting Circuit Pump 750 RPM to true  from  false
[7/16/2020, 4:15:29 PM] [PoolControllerPlatform] Executing request - server: http://ospi.local:4200, command: toggleCircuit, data: { id: 7 }
[7/16/2020, 4:15:29 PM] [PoolControllerPlatform] Sending command to pool controller server:  { method: 'put',
  data: { id: 7 },
  url: 'http://ospi.local:4200/state/circuit/toggleState' }
[7/16/2020, 4:15:58 PM] [PoolControllerPlatform] Setting Circuit Pump 750 RPM to false  from  false
gadget-monk commented 4 years ago

I am assuming still no “FROM CURCUIT CLIENT” messages in the log? Till the socket events come in from njspc come in, the plug in can’t update state. The state will be accurate when the plugin is first launched but in order to stay in sync it needs the updates coming in from the server.

dkossman commented 4 years ago

correct - no such messages. i'm not sure what other info i can provide, but i would point out that the web client works correctly. I'm not sure what the difference is between how it talks to njspc versus how the plugin does?

dkossman commented 4 years ago

turned on Homebridge debug.
updated homebridge to latest 1.2.0 beta30, updated my homebridge plugins, updated njspc with git pull and npm start

This is the homebridge log after turning on the 750RPM switch on the Home app. I've turned off the web client to avoid any confusion.

same behavior as before - Home switches do not reflect actual state of pump.

2020-07-17T23:44:57.433Z HAP-NodeJS:EventedHTTPServer [::ffff:10.0.1.8] HTTP request: /characteristics
2020-07-17T23:44:57.441Z HAP-NodeJS:HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics
2020-07-17T23:44:57.444Z HAP-NodeJS:Accessory [Homebridge CAD8] Processing characteristic set: [{"aid":71,"iid":10,"value":1}]
2020-07-17T23:44:57.445Z HAP-NodeJS:Accessory [Homebridge CAD8] Setting Characteristic "On" to value 1
[7/17/2020, 4:44:57 PM] [PoolControllerPlatform] Setting Circuit Pump 750 RPM to true  from  false
[7/17/2020, 4:44:57 PM] [PoolControllerPlatform] Executing request - server: http://ospi.local:4200, command: toggleCircuit, data: { id: 7 }
[7/17/2020, 4:44:57 PM] [PoolControllerPlatform] Sending command to pool controller server:  { method: 'put',
  data: { id: 7 },
  url: 'http://ospi.local:4200/state/circuit/toggleState' }
2020-07-17T23:44:57.474Z HAP-NodeJS:EventedHTTPServer [::ffff:10.0.1.24] Sending HTTP event '71.10' with data: {"characteristics":[{"aid":71,"iid":10,"value":true}]}
2020-07-17T23:44:57.508Z HAP-NodeJS:EventedHTTPServer [::ffff:10.0.1.8] Sending HTTP event '71.10' with data: {"characteristics":[{"aid":71,"iid":10,"value":true}]}
2020-07-17T23:44:57.521Z HAP-NodeJS:EventedHTTPServer [::ffff:10.0.1.24] Sending HTTP event '71.10' with data: {"characteristics":[{"aid":71,"iid":10,"value":true}]}
2020-07-17T23:44:57.526Z HAP-NodeJS:EventedHTTPServer [::ffff:10.0.1.8] Muting event '71.10' notification for this connection since it originated here.
2020-07-17T23:44:57.530Z HAP-NodeJS:EventedHTTPServer [::ffff:10.0.1.8] HTTP Response is finished
2020-07-17T23:44:57.532Z HAP-NodeJS:EventedHTTPServer [::ffff:10.0.1.8] Writing pending HTTP event data
2020-07-17T23:44:57.541Z follow-redirects options { protocol: 'http:',
  maxRedirects: 21,
  maxBodyLength: 10485760,
  path: '/state/circuit/toggleState',
  method: 'PUT',
  headers:
   { Accept: 'application/json, text/plain, */*',
     'Content-Type': 'application/json;charset=utf-8',
     'User-Agent': 'axios/0.19.2',
     'Content-Length': 8 },
  agent: undefined,
  agents: { http: undefined, https: undefined },
  auth: undefined,
  hostname: 'ospi.local',
  port: '4200',
  nativeProtocols:
   { 'http:':
      { _connectionListener: [Function: connectionListener],
        METHODS: [Array],
        STATUS_CODES: [Object],
        Agent: [Function],
        ClientRequest: [Function: ClientRequest],
        globalAgent: [Agent],
        IncomingMessage: [Function: IncomingMessage],
        OutgoingMessage: [Function: OutgoingMessage],
        Server: [Function: Server],
        ServerResponse: [Function: ServerResponse],
        createServer: [Function: createServer],
        get: [Function: get],
        request: [Function: request] },
     'https:':
      { Agent: [Function: Agent],
        globalAgent: [Agent],
        Server: [Function: Server],
        createServer: [Function: createServer],
        get: [Function: get],
        request: [Function: request] } } }
2020-07-17T23:44:57.577Z engine.io-client:socket writing ping packet - expecting pong within 5000ms
2020-07-17T23:44:57.578Z engine.io-client:socket flushing 1 packets in socket
2020-07-17T23:44:57.690Z engine.io-client:socket socket receive: type "pong", data "undefined"
2020-07-17T23:44:57.776Z engine.io-client:socket socket receive: type "message", data "2["feature",{"id":7,"isOn":true,"name":"Pump 750 RPM","type":{"val":0,"name":"generic","desc":"Generic"},"showInFeatures":true}]"
2020-07-17T23:44:57.780Z socket.io-parser decoded 2["feature",{"id":7,"isOn":true,"name":"Pump 750 RPM","type":{"val":0,"name":"generic","desc":"Generic"},"showInFeatures":true}] as {"type":2,"nsp":"/","data":["feature",{"id":7,"isOn":true,"name":"Pump 750 RPM","type":{"val":0,"name":"generic","desc":"Generic"},"showInFeatures":true}]}
2020-07-17T23:44:57.783Z socket.io-client:socket emitting event ["feature",{"id":7,"isOn":true,"name":"Pump 750 RPM","type":{"val":0,"name":"generic","desc":"Generic"},"showInFeatures":true}]
2020-07-17T23:44:58.381Z engine.io-client:socket socket receive: type "message", data "2["pump",{"id":1,"type":{"val":128,"name":"vs","desc":"Intelliflo VS","maxPrimingTime":6,"minSpeed":450,"maxSpeed":3450,"speedStepSize":10,"maxCircuits":8,"hasAddress":true},"status":{"name":"off","desc":"Off","val":0},"targetSpeed":750,"virtualControllerStatus":{"val":1,"name":"running","desc":"Running"},"command":4,"mode":0,"driveState":255,"watts":0,"rpm":0,"flow":55,"ppc":44,"name":"Intelliflo VS","time":1005}]"
2020-07-17T23:44:58.386Z socket.io-parser decoded 2["pump",{"id":1,"type":{"val":128,"name":"vs","desc":"Intelliflo VS","maxPrimingTime":6,"minSpeed":450,"maxSpeed":3450,"speedStepSize":10,"maxCircuits":8,"hasAddress":true},"status":{"name":"off","desc":"Off","val":0},"targetSpeed":750,"virtualControllerStatus":{"val":1,"name":"running","desc":"Running"},"command":4,"mode":0,"driveState":255,"watts":0,"rpm":0,"flow":55,"ppc":44,"name":"Intelliflo VS","time":1005}] as {"type":2,"nsp":"/","data":["pump",{"id":1,"type":{"val":128,"name":"vs","desc":"Intelliflo VS","maxPrimingTime":6,"minSpeed":450,"maxSpeed":3450,"speedStepSize":10,"maxCircuits":8,"hasAddress":true},"status":{"name":"off","desc":"Off","val":0},"targetSpeed":750,"virtualControllerStatus":{"val":1,"name":"running","desc":"Running"},"command":4,"mode":0,"driveState":255,"watts":0,"rpm":0,"flow":55,"ppc":44,"name":"Intelliflo VS","time":1005}]}
2020-07-17T23:44:58.391Z socket.io-client:socket emitting event ["pump",{"id":1,"type":{"val":128,"name":"vs","desc":"Intelliflo VS","maxPrimingTime":6,"minSpeed":450,"maxSpeed":3450,"speedStepSize":10,"maxCircuits":8,"hasAddress":true},"status":{"name":"off","desc":"Off","val":0},"targetSpeed":750,"virtualControllerStatus":{"val":1,"name":"running","desc":"Running"},"command":4,"mode":0,"driveState":255,"watts":0,"rpm":0,"flow":55,"ppc":44,"name":"Intelliflo VS","time":1005}]
2020-07-17T23:45:03.566Z engine.io-client:socket socket receive: type "message", data "2["pump",{"id":1,"type":{"val":128,"name":"vs","desc":"Intelliflo VS","maxPrimingTime":6,"minSpeed":450,"maxSpeed":3450,"speedStepSize":10,"maxCircuits":8,"hasAddress":true},"status":{"name":"priming","desc":"Priming","val":11},"targetSpeed":750,"virtualControllerStatus":{"val":1,"name":"running","desc":"Running"},"command":10,"mode":17,"driveState":1,"watts":125,"rpm":1114,"flow":55,"ppc":44,"name":"Intelliflo VS","time":1005}]"
2020-07-17T23:45:03.571Z socket.io-parser decoded 2["pump",{"id":1,"type":{"val":128,"name":"vs","desc":"Intelliflo VS","maxPrimingTime":6,"minSpeed":450,"maxSpeed":3450,"speedStepSize":10,"maxCircuits":8,"hasAddress":true},"status":{"name":"priming","desc":"Priming","val":11},"targetSpeed":750,"virtualControllerStatus":{"val":1,"name":"running","desc":"Running"},"command":10,"mode":17,"driveState":1,"watts":125,"rpm":1114,"flow":55,"ppc":44,"name":"Intelliflo VS","time":1005}] as {"type":2,"nsp":"/","data":["pump",{"id":1,"type":{"val":128,"name":"vs","desc":"Intelliflo VS","maxPrimingTime":6,"minSpeed":450,"maxSpeed":3450,"speedStepSize":10,"maxCircuits":8,"hasAddress":true},"status":{"name":"priming","desc":"Priming","val":11},"targetSpeed":750,"virtualControllerStatus":{"val":1,"name":"running","desc":"Running"},"command":10,"mode":17,"driveState":1,"watts":125,"rpm":1114,"flow":55,"ppc":44,"name":"Intelliflo VS","time":1005}]}
2020-07-17T23:45:03.572Z socket.io-client:socket emitting event ["pump",{"id":1,"type":{"val":128,"name":"vs","desc":"Intelliflo VS","maxPrimingTime":6,"minSpeed":450,"maxSpeed":3450,"speedStepSize":10,"maxCircuits":8,"hasAddress":true},"status":{"name":"priming","desc":"Priming","val":11},"targetSpeed":750,"virtualControllerStatus":{"val":1,"name":"running","desc":"Running"},"command":10,"mode":17,"driveState":1,"watts":125,"rpm":1114,"flow":55,"ppc":44,"name":"Intelliflo VS","time":1005}]
2020-07-17T23:45:03.862Z engine.io-client:socket socket receive: type "message", data "2["pump",{"id":1,"type":{"val":128,"name":"vs","desc":"Intelliflo VS","maxPrimingTime":6,"minSpeed":450,"maxSpeed":3450,"speedStepSize":10,"maxCircuits":8,"hasAddress":true},"status":{"name":"priming","desc":"Priming","val":11},"targetSpeed":750,"virtualControllerStatus":{"val":1,"name":"running","desc":"Running"},"command":10,"mode":17,"driveState":1,"watts":175,"rpm":1286,"flow":55,"ppc":44,"name":"Intelliflo VS","time":1005}]"
2020-07-17T23:45:03.864Z socket.io-parser decoded 2["pump",{"id":1,"type":{"val":128,"name":"vs","desc":"Intelliflo VS","maxPrimingTime":6,"minSpeed":450,"maxSpeed":3450,"speedStepSize":10,"maxCircuits":8,"hasAddress":true},"status":{"name":"priming","desc":"Priming","val":11},"targetSpeed":750,"virtualControllerStatus":{"val":1,"name":"running","desc":"Running"},"command":10,"mode":17,"driveState":1,"watts":175,"rpm":1286,"flow":55,"ppc":44,"name":"Intelliflo VS","time":1005}] as {"type":2,"nsp":"/","data":["pump",{"id":1,"type":{"val":128,"name":"vs","desc":"Intelliflo VS","maxPrimingTime":6,"minSpeed":450,"maxSpeed":3450,"speedStepSize":10,"maxCircuits":8,"hasAddress":true},"status":{"name":"priming","desc":"Priming","val":11},"targetSpeed":750,"virtualControllerStatus":{"val":1,"name":"running","desc":"Running"},"command":10,"mode":17,"driveState":1,"watts":175,"rpm":1286,"flow":55,"ppc":44,"name":"Intelliflo VS","time":1005}]}
2020-07-17T23:45:03.866Z socket.io-client:socket emitting event ["pump",{"id":1,"type":{"val":128,"name":"vs","desc":"Intelliflo VS","maxPrimingTime":6,"minSpeed":450,"maxSpeed":3450,"speedStepSize":10,"maxCircuits":8,"hasAddress":true},"status":{"name":"priming","desc":"Priming","val":11},"targetSpeed":750,"virtualControllerStatus":{"val":1,"name":"running","desc":"Running"},"command":10,"mode":17,"driveState":1,"watts":175,"rpm":1286,"flow":55,"ppc":44,"name":"Intelliflo VS","time":1005}]
2020-07-17T23:45:08.673Z ciao:NetworkManager Checking for new networks...
2020-07-17T23:45:08.746Z engine.io-client:socket socket receive: type "message", data "2["pump",{"id":1,"type":{"val":128,"name":"vs","desc":"Intelliflo VS","maxPrimingTime":6,"minSpeed":450,"maxSpeed":3450,"speedStepSize":10,"maxCircuits":8,"hasAddress":true},"status":{"name":"off","desc":"Off","val":0},"targetSpeed":750,"virtualControllerStatus":{"val":1,"name":"running","desc":"Running"},"command":10,"mode":9,"driveState":1,"watts":80,"rpm":1144,"flow":55,"ppc":44,"name":"Intelliflo VS","time":1005}]"
2020-07-17T23:45:08.752Z socket.io-parser decoded 2["pump",{"id":1,"type":{"val":128,"name":"vs","desc":"Intelliflo VS","maxPrimingTime":6,"minSpeed":450,"maxSpeed":3450,"speedStepSize":10,"maxCircuits":8,"hasAddress":true},"status":{"name":"off","desc":"Off","val":0},"targetSpeed":750,"virtualControllerStatus":{"val":1,"name":"running","desc":"Running"},"command":10,"mode":9,"driveState":1,"watts":80,"rpm":1144,"flow":55,"ppc":44,"name":"Intelliflo VS","time":1005}] as {"type":2,"nsp":"/","data":["pump",{"id":1,"type":{"val":128,"name":"vs","desc":"Intelliflo VS","maxPrimingTime":6,"minSpeed":450,"maxSpeed":3450,"speedStepSize":10,"maxCircuits":8,"hasAddress":true},"status":{"name":"off","desc":"Off","val":0},"targetSpeed":750,"virtualControllerStatus":{"val":1,"name":"running","desc":"Running"},"command":10,"mode":9,"driveState":1,"watts":80,"rpm":1144,"flow":55,"ppc":44,"name":"Intelliflo VS","time":1005}]}
2020-07-17T23:45:08.756Z socket.io-client:socket emitting event ["pump",{"id":1,"type":{"val":128,"name":"vs","desc":"Intelliflo VS","maxPrimingTime":6,"minSpeed":450,"maxSpeed":3450,"speedStepSize":10,"maxCircuits":8,"hasAddress":true},"status":{"name":"off","desc":"Off","val":0},"targetSpeed":750,"virtualControllerStatus":{"val":1,"name":"running","desc":"Running"},"command":10,"mode":9,"driveState":1,"watts":80,"rpm":1144,"flow":55,"ppc":44,"name":"Intelliflo VS","time":1005}]
2020-07-17T23:45:09.045Z engine.io-client:socket socket receive: type "message", data "2["pump",{"id":1,"type":{"val":128,"name":"vs","desc":"Intelliflo VS","maxPrimingTime":6,"minSpeed":450,"maxSpeed":3450,"speedStepSize":10,"maxCircuits":8,"hasAddress":true},"status":{"name":"off","desc":"Off","val":0},"targetSpeed":750,"virtualControllerStatus":{"val":1,"name":"running","desc":"Running"},"command":10,"mode":9,"driveState":1,"watts":62,"rpm":971,"flow":55,"ppc":44,"name":"Intelliflo VS","time":1005}]"
2020-07-17T23:45:09.054Z socket.io-parser decoded 2["pump",{"id":1,"type":{"val":128,"name":"vs","desc":"Intelliflo VS","maxPrimingTime":6,"minSpeed":450,"maxSpeed":3450,"speedStepSize":10,"maxCircuits":8,"hasAddress":true},"status":{"name":"off","desc":"Off","val":0},"targetSpeed":750,"virtualControllerStatus":{"val":1,"name":"running","desc":"Running"},"command":10,"mode":9,"driveState":1,"watts":62,"rpm":971,"flow":55,"ppc":44,"name":"Intelliflo VS","time":1005}] as {"type":2,"nsp":"/","data":["pump",{"id":1,"type":{"val":128,"name":"vs","desc":"Intelliflo VS","maxPrimingTime":6,"minSpeed":450,"maxSpeed":3450,"speedStepSize":10,"maxCircuits":8,"hasAddress":true},"status":{"name":"off","desc":"Off","val":0},"targetSpeed":750,"virtualControllerStatus":{"val":1,"name":"running","desc":"Running"},"command":10,"mode":9,"driveState":1,"watts":62,"rpm":971,"flow":55,"ppc":44,"name":"Intelliflo VS","time":1005}]}
2020-07-17T23:45:09.058Z socket.io-client:socket emitting event ["pump",{"id":1,"type":{"val":128,"name":"vs","desc":"Intelliflo VS","maxPrimingTime":6,"minSpeed":450,"maxSpeed":3450,"speedStepSize":10,"maxCircuits":8,"hasAddress":true},"status":{"name":"off","desc":"Off","val":0},"targetSpeed":750,"virtualControllerStatus":{"val":1,"name":"running","desc":"Running"},"command":10,"mode":9,"driveState":1,"watts":62,"rpm":971,"flow":55,"ppc":44,"name":"Intelliflo VS","time":1005}]
2020-07-17T23:45:13.981Z engine.io-client:socket socket receive: type "message", data "2["pump",{"id":1,"type":{"val":128,"name":"vs","desc":"Intelliflo VS","maxPrimingTime":6,"minSpeed":450,"maxSpeed":3450,"speedStepSize":10,"maxCircuits":8,"hasAddress":true},"status":{"name":"off","desc":"Off","val":0},"targetSpeed":750,"virtualControllerStatus":{"val":1,"name":"running","desc":"Running"},"command":10,"mode":9,"driveState":1,"watts":40,"rpm":750,"flow":55,"ppc":44,"name":"Intelliflo VS","time":1005}]"
2020-07-17T23:45:13.991Z socket.io-parser decoded 2["pump",{"id":1,"type":{"val":128,"name":"vs","desc":"Intelliflo VS","maxPrimingTime":6,"minSpeed":450,"maxSpeed":3450,"speedStepSize":10,"maxCircuits":8,"hasAddress":true},"status":{"name":"off","desc":"Off","val":0},"targetSpeed":750,"virtualControllerStatus":{"val":1,"name":"running","desc":"Running"},"command":10,"mode":9,"driveState":1,"watts":40,"rpm":750,"flow":55,"ppc":44,"name":"Intelliflo VS","time":1005}] as {"type":2,"nsp":"/","data":["pump",{"id":1,"type":{"val":128,"name":"vs","desc":"Intelliflo VS","maxPrimingTime":6,"minSpeed":450,"maxSpeed":3450,"speedStepSize":10,"maxCircuits":8,"hasAddress":true},"status":{"name":"off","desc":"Off","val":0},"targetSpeed":750,"virtualControllerStatus":{"val":1,"name":"running","desc":"Running"},"command":10,"mode":9,"driveState":1,"watts":40,"rpm":750,"flow":55,"ppc":44,"name":"Intelliflo VS","time":1005}]}
2020-07-17T23:45:13.993Z socket.io-client:socket emitting event ["pump",{"id":1,"type":{"val":128,"name":"vs","desc":"Intelliflo VS","maxPrimingTime":6,"minSpeed":450,"maxSpeed":3450,"speedStepSize":10,"maxCircuits":8,"hasAddress":true},"status":{"name":"off","desc":"Off","val":0},"targetSpeed":750,"virtualControllerStatus":{"val":1,"name":"running","desc":"Running"},"command":10,"mode":9,"driveState":1,"watts":40,"rpm":750,"flow":55,"ppc":44,"name":"Intelliflo VS","time":1005}]
dkossman commented 4 years ago

Let me know if there is anything else i can do to help figure this out.

rstrouse commented 4 years ago

I see the feature emit in the log above. However your message says setting from true to false. By chance do you have the states mixed up?

dkossman commented 4 years ago

not sure if i just didn't notice this previously, but now the Home app shows the Intelliflo VS fan control at 21%, Pool On and the 750 virtual circuit On. This doesn't change if i change turn on/off the circuits via the web app.

Screenshot attached

Screen Shot 2020-07-17 at Jul 17, 2020  8 03 49 PM
gadget-monk commented 4 years ago

I made some tweaks to the socket.io code in the plugin. Can you try the new version? Ideally you should see a message in the logs along the lines of: [PoolControllerPlatform] homebridge-poolcontroller connected to the server [PoolControllerPlatform] Socket connection status: true

dkossman commented 4 years ago

updated plugin. Initial state: Pool off, all circuits off.
Turned on Home Pool switch -> reflected in web client. initially reflected in Home Turned on 450 RPM switch -> reflected in web client. initially reflected in Home Turned off 450 RPM switch -> no change in web client. After Home app refreshes, all switches are off, including Fan control

[7/18/2020, 7:52:41 AM] Homebridge is running on port 51826.
[7/18/2020, 7:52:41 AM] [PoolControllerPlatform] Version checked OK, getting config data
[7/18/2020, 7:52:41 AM] [PoolControllerPlatform] Sending command to pool controller server:  { method: 'get',
  data: undefined,
  url: 'http://ospi.local:4200/state/all' }
[7/18/2020, 7:52:42 AM] [PoolControllerPlatform] Ignoring controller ready state. Controller state is: ready (1)
[7/18/2020, 7:52:42 AM] [PoolControllerPlatform] InitialData:  { time: '2020-07-12T15:46:00.411-0700',
  valve: 0,
  batteryVoltage: 0,
  status: { val: 1, name: 'ready', desc: 'Ready', percent: 100 },
  mode: { val: 0, name: 'auto', desc: 'Auto' },
  appVersion: '6.0.0',
  circuits:
   [ { id: 6,
       name: 'Pool',
       type: [Object],
       isOn: false,
       equipmentType: 'circuit' } ],
  temps:
   { units: { val: 0, name: 'F', desc: 'Fahrenheit' },
     bodies: [ [Object] ],
     equipmentType: 'temps' },
  equipment:
   { model: 'Virtual Controller',
     maxBodies: 1,
     equipmentType: 'equipment',
     softwareVersion: '',
     bootLoaderVersion: '' },
  pumps:
   [ { id: 1,
       type: [Object],
       status: [Object],
       targetSpeed: 0,
       virtualControllerStatus: [Object],
       command: 4,
       mode: 3,
       driveState: 255,
       watts: 0,
       rpm: 0,
       flow: 55,
       ppc: 44,
       name: 'Intelliflo VS',
       time: 473,
       equipmentType: 'pump',
       minSpeed: 450,
       maxSpeed: 3450,
       speedStepSize: 10,
       circuits: [Array] } ],
  valves: [],
  heaters: [],
  chlorinators: [],
  features:
   [ { id: 7,
       isOn: false,
       name: 'Pump 750 RPM',
       type: [Object],
       showInFeatures: true,
       equipmentType: 'feature' },
     { id: 8,
       isOn: false,
       name: 'Pump 1500 RPM',
       type: [Object],
       showInFeatures: true,
       equipmentType: 'feature' },
     { id: 9,
       isOn: false,
       name: 'Pump 2500 RPM',
       type: [Object],
       showInFeatures: true,
       equipmentType: 'feature' },
     { id: 10,
       isOn: false,
       name: 'Pump 3000 RPM',
       type: [Object],
       showInFeatures: true,
       equipmentType: 'feature' } ],
  circuitGroups: [],
  lightGroups: [],
  virtualCircuits: [],
  covers: [],
  schedules: [],
  chemControllers: [] }
[7/18/2020, 7:52:42 AM] [PoolControllerPlatform] Using cached circuit accessory: circuitNumber: 6, id: poolController.6.Pool
[7/18/2020, 7:52:42 AM] [PoolControllerPlatform] Using cached circuit accessory: circuitNumber: 7, id: poolController.7.Pump 750 RPM
[7/18/2020, 7:52:42 AM] [PoolControllerPlatform] Using cached circuit accessory: circuitNumber: 8, id: poolController.8.Pump 1500 RPM
[7/18/2020, 7:52:42 AM] [PoolControllerPlatform] Using cached circuit accessory: circuitNumber: 9, id: poolController.9.Pump 2500 RPM
[7/18/2020, 7:52:42 AM] [PoolControllerPlatform] Using cached circuit accessory: circuitNumber: 10, id: poolController.10.Pump 3000 RPM
[7/18/2020, 7:52:42 AM] [PoolControllerPlatform] Using cached pump: Intelliflo VS
[7/18/2020, 7:52:53 AM] [PoolControllerPlatform] Updating pump to  false
[7/18/2020, 7:52:53 AM] [PoolControllerPlatform] watts  0
[7/18/2020, 7:52:53 AM] [PoolControllerPlatform] RPM %  0
[7/18/2020, 7:52:53 AM] [PoolControllerPlatform] Flow  55
(node:11835) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'val' of undefined
    at PoolControllerAccessory.updateState (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/controllerAccessory.js:60:145)
    at new PoolControllerAccessory (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/controllerAccessory.js:35:10)
    at PoolControllerPlatform.addControllerAccessory (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/index.js:553:30)
    at PoolControllerPlatform.InitialData (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/index.js:266:18)
    at PoolControllerPlatform.validateVersion (/opt/nodejs/lib/node_modules/homebridge-poolcontroller/index.js:126:14)
    at process.internalTickCallback (internal/process/next_tick.js:77:7)
(node:11835) 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(). (rejection id: 1)
(node:11835) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[7/18/2020, 7:54:27 AM] [PoolControllerPlatform] Setting Circuit Pool to true  from  false
[7/18/2020, 7:54:27 AM] [PoolControllerPlatform] Sending command to pool controller server:  { method: 'put',
  data: { id: 6 },
  url: 'http://ospi.local:4200/state/circuit/toggleState' }
[7/18/2020, 7:54:40 AM] [PoolControllerPlatform] Setting Circuit Pump 750 RPM to true  from  false
[7/18/2020, 7:54:40 AM] [PoolControllerPlatform] Sending command to pool controller server:  { method: 'put',
  data: { id: 7 },
  url: 'http://ospi.local:4200/state/circuit/toggleState' }
[7/18/2020, 7:55:05 AM] [PoolControllerPlatform] Setting Circuit Pump 750 RPM to false  from  false
dkossman commented 4 years ago

Let me know if it would be helpful to turn on Debug in homebridge and send the log or if there is any other info i can provide

gadget-monk commented 4 years ago

Let me know if everything is working with the latest update so i can close the issue

dkossman commented 4 years ago

all good now! pump feature switches in Home app work as expected, and the fan control shows RPM as percentage of max. thanks!