Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error setting serial number in logs #18

Closed
apexskier opened this issue Dec 14, 2023 · 8 comments
Closed

Error setting serial number in logs #18

apexskier opened this issue Dec 14, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@apexskier
Copy link

Describe The Bug:
Plugin still works, but there's an error in the logs

To Reproduce:
Just happens on startup

Expected behavior:
No error in logs

Logs:

[14/12/2023, 10:53:23] [homebridge-weatherflow-tempest] This plugin generated a warning from the characteristic 'Serial Number': [Serial Number] characteristic must have a length of more than 1 character otherwise         HomeKit will reject this accessory, ignoring new value. See https://homebridge.io/w/JtMGR for more info.
[14/12/2023, 10:53:23] [homebridge-weatherflow-tempest] Error: 
    at SerialNumber.Characteristic.characteristicWarning (/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:3011:105)
    at SerialNumber.Characteristic.validateUserInput (/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2963:14)
    at SerialNumber.Characteristic.setValue (/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Characteristic.ts:2229:20)
    at AccessoryInformation.Service.setCharacteristic (/var/lib/homebridge/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Service.ts:758:35)
    at new WeatherFlowTempestPlatformAccessory (/var/lib/homebridge/node_modules/homebridge-weatherflow-tempest/src/platformAccessory.ts:642:8)
    at WeatherFlowTempestPlatform.initAccessory (/var/lib/homebridge/node_modules/homebridge-weatherflow-tempest/src/platform.ts:351:9)
    at WeatherFlowTempestPlatform.discoverDevices (/var/lib/homebridge/node_modules/homebridge-weatherflow-tempest/src/platform.ts:297:14)
    at WeatherFlowTempestPlatform.initializeBySocket (/var/lib/homebridge/node_modules/homebridge-weatherflow-tempest/src/platform.ts:114:12)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

Plugin Config:

{
  "name": "Tempest",
  "local_api": true,
  "token": "<Your API Token>",
  "station_id": 0,
  "interval": 10,
  "units": "Standard",
  "sensors": [
    {
      "name": "Air Temperature",
      "sensor_type": "Temperature Sensor",
      "temperature_properties": {
        "value_key": "air_temperature"
      }
    },
    {
      "name": "Humidity",
      "sensor_type": "Humidity Sensor",
      "humidity_properties": {
        "value_key": "relative_humidity"
      }
    },
    {
      "name": "Brightness",
      "sensor_type": "Light Sensor",
      "light_properties": {
        "value_key": "brightness"
      }
    },
    {
      "name": "Feels Like",
      "sensor_type": "Temperature Sensor",
      "temperature_properties": {
        "value_key": "feels_like"
      }
    },
    {
      "name": "Wind Gust",
      "sensor_type": "Motion Sensor",
      "motion_properties": {
        "value_key": "wind_gust",
        "trigger_value": 3
      }
    },
    {
      "name": "Rain",
      "sensor_type": "Occupancy Sensor",
      "occupancy_properties": {
        "value_key": "precip",
        "trigger_value": 0
      }
    }
  ],
  "_bridge": {
    "username": "0E:C9:A9:4B:4B:4B",
    "port": 42489
  },
  "platform": "WeatherFlowTempest"
}

Environment:

  • Plugin Version: v4.0.0
  • Homebridge Version: 1.7.0
  • Node.js Version: v20.9.0
  • NPM Version: 10.1.0
  • Operating System: Raspbian
@apexskier apexskier added the bug Something isn't working label Dec 14, 2023
@DMBlakeley
Copy link
Collaborator

DMBlakeley commented Dec 14, 2023

Nice catch!

If you edit the Plugin Config and change "station_id": 0, to "station_id": 12345, the error will go away.

Will need to update the plugin to check for a 0 entry which is the case when you install the plugin and directly use local mode.

@chasenicholl
Copy link
Owner

Great catch, thank you. I'll work on a patch release soon.

@DMBlakeley
Copy link
Collaborator

@chasenicholl, I submitted a 4.0.1 pull request to address this issue.

@chasenicholl
Copy link
Owner

@apexskier thanks for the bug ticket. This has been addressed by @DMBlakeley in a just published patch release v4.0.1

Thank you everyone.

@bourquep
Copy link
Contributor

I'm seeing this in a just-installed v4.0.2:

[10/16/2024, 7:40:21 AM] [WeatherFlow Tempest Platform] Initial local broadcast recieved.
[10/16/2024, 7:40:21 AM] [WeatherFlow Tempest Platform] Adding new accessory: Temperature
[Temperature@@Serial Number] [Serial Number] characteristic must have a length of more than 1 character otherwise         HomeKit will reject this accessory, ignoring new value
[10/16/2024, 7:40:21 AM] [WeatherFlow Tempest Platform] Adding new accessory: Feels Like
[Feels Like@@Serial Number] [Serial Number] characteristic must have a length of more than 1 character otherwise         HomeKit will reject this accessory, ignoring new value
[10/16/2024, 7:40:21 AM] [WeatherFlow Tempest Platform] Adding new accessory: Humidity
[Humidity@@Serial Number] [Serial Number] characteristic must have a length of more than 1 character otherwise         HomeKit will reject this accessory, ignoring new value
[10/16/2024, 7:40:21 AM] [WeatherFlow Tempest Platform] Adding new accessory: Wind
[Wind@@Serial Number] [Serial Number] characteristic must have a length of more than 1 character otherwise         HomeKit will reject this accessory, ignoring new value
[10/16/2024, 7:40:21 AM] [WeatherFlow Tempest Platform] Adding new accessory: Brightness
[Brightness@@Serial Number] [Serial Number] characteristic must have a length of more than 1 character otherwise         HomeKit will reject this accessory, ignoring new value
[10/16/2024, 7:40:21 AM] [WeatherFlow Tempest Platform] Adding new accessory: Rain
[Rain@@Serial Number] [Serial Number] characteristic must have a length of more than 1 character otherwise         HomeKit will reject this accessory, ignoring new value
[10/16/2024, 7:40:21 AM] [WeatherFlow Tempest Platform] discoverDevices completed
[10/16/2024, 7:40:21 AM] [WeatherFlow Tempest Platform] removeDevices completed

@DMBlakeley
Copy link
Collaborator

Believe the problem is that you may have created the config.json file manually rather than use the Plugin Config option and the "Name" field is missing or is blank.

If this is not the issue, would be best if you shared your JSON config file. Redact your station number.

@bourquep
Copy link
Contributor

I configured the plugin using the UI right after installing it. Then I manually edited the config.json to add my station_id and the warning went away.

@DMBlakeley
Copy link
Collaborator

Thanks for submitting! Manually adding the station_id pointed at the problem. On initial configuration with Local mode, station_id is null which produces the error that you saw. Will push an update to @chasenicholl for review and release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants