cyberjunky / home-assistant-custom-components

My custom components for Home Assistant
MIT License
71 stars 19 forks source link

[Smartmeter] Sensors remain "unknown" #33

Closed hmmbob closed 5 years ago

hmmbob commented 5 years ago

Got a new Smartmeter the other day and tried to connect it to Home Assistant via your Custom Component. However, the sensors all remain "unknown" in HA.

Relevant config:

# sensors.yaml
- platform: toon_smartmeter
  host: !secret toon_host
  port: !secret toon_port
  scan_interval: 60
  resources:
#    - gasused  #No Gas smart meter module yet
#    - gasusedcnt
    - elecusageflowlow
    - elecusagecntlow
    - elecusageflowhigh
    - elecusagecnthigh
    - heat

JSON from Toon:


{"dev_settings_device": 
    {"uuid": "616d0bfd-646f-422e-ab09-0251102dbd12", "name": "settings_device", "internalAddress": "settings_device", "type": "settings_device"}, 
    "dev_2":   {"uuid": "935246f8-0fbf-4b71-9a69-d72f7b43130c", "name": "HAE_METER_v3", "internalAddress": "2", "type": "HAE_METER_v3", "supportsCrc": "1", "ccList": "5e 86 72 32 56 5a 59 85 73 7a 60 8e 22 70 8b 3c 3d 3e", "supportedCC": "5e 86 72 32 56 5a 59 85 73 7a 60 8e 22 70 8b 3c 3d 3e", "nodeFlags": [], "IsConnected": "1", "HealthValue": "-1", "DeviceName": "HAE_METER_v3", "CurrentSensorStatus": "UNKNOWN"},
    "dev_2.1": {"uuid": "41c54ffc-e075-4f2c-81ee-42328b7efc0f", "name": "HAE_METER_v3_1", "internalAddress": "2.1", "type": "HAE_METER_v3_1", "supportsCrc": "0", "ccList": "5e 59 85 8e 3c 3d 3e", "supportedCC": "5e 59 85 8e 3c 3d 3e", "nodeFlags": [], "CurrentSensorStatus": "COMMISSIONING", "CurrentGasFlow": "0.00", "CurrentGasQuantity": "0.00", "DeviceName": ""}, 
    "dev_2.2": {"uuid": "a1b51016-0e26-4542-85d1-5aa6b6c4dab4", "name": "HAE_METER_v3_2", "internalAddress": "2.2", "type": "HAE_METER_v3_2", "supportsCrc": "0", "ccList": "5e 59 85 8e 3c 3d 3e", "supportedCC": "5e 59 85 8e 3c 3d 3e", "nodeFlags": [], "CurrentSensorStatus": "DISABLED", "DeviceName": "", "CurrentElectricityFlow": "NaN", "CurrentElectricityQuantity": "NaN"}, 
    "dev_2.3": {"uuid": "e89338cc-158e-439e-a53b-a92139738f39", "name": "HAE_METER_v3_3", "internalAddress": "2.3", "type": "HAE_METER_v3_3", "supportsCrc": "0", "ccList": "5e 59 85 8e 3c 3d 3e", "supportedCC": "5e 59 85 8e 3c 3d 3e", "nodeFlags": [], "CurrentSensorStatus": "UNKNOWN", "DeviceName": "", "CurrentElectricityFlow": "NaN", "CurrentElectricityQuantity": "NaN"}, 
    "dev_2.4": {"uuid": "4e23518f-449b-440e-9dd4-c5af902c2074", "name": "HAE_METER_v3_4", "internalAddress": "2.4", "type": "HAE_METER_v3_4", "supportsCrc": "0", "ccList": "5e 59 85 8e 3c 3d 3e", "supportedCC": "5e 59 85 8e 3c 3d 3e", "nodeFlags": [], "CurrentSensorStatus": "OPERATIONAL", "DeviceName": "", "CurrentElectricityFlow": "0.00", "CurrentElectricityQuantity": "4103.00"}, 
    "dev_2.5": {"uuid": "06ecd825-c0da-4b81-b2fb-29c7be487ee0", "name": "HAE_METER_v3_5", "internalAddress": "2.5", "type": "HAE_METER_v3_5", "supportsCrc": "0", "ccList": "5e 59 85 8e 3c 3d 3e", "supportedCC": "5e 59 85 8e 3c 3d 3e", "nodeFlags": [], "CurrentSensorStatus": "OPERATIONAL", "DeviceName": "", "CurrentElectricityFlow": "0.00", "CurrentElectricityQuantity": "0.00"}, 
    "dev_2.6": {"uuid": "c364a3bd-1886-4b93-a14b-fd0073adf472", "name": "HAE_METER_v3_6", "internalAddress": "2.6", "type": "HAE_METER_v3_6", "supportsCrc": "0", "ccList": "5e 59 85 8e 3c 3d 3e", "supportedCC": "5e 59 85 8e 3c 3d 3e", "nodeFlags": [], "CurrentSensorStatus": "OPERATIONAL", "DeviceName": "", "CurrentElectricityFlow": "284.00", "CurrentElectricityQuantity": "5260.00"}, 
    "dev_2.7": {"uuid": "a71ac503-f1c2-4c49-a40a-8c2e0b52799a", "name": "HAE_METER_v3_7", "internalAddress": "2.7", "type": "HAE_METER_v3_7", "supportsCrc": "0", "ccList": "5e 59 85 8e 3c 3d 3e", "supportedCC": "5e 59 85 8e 3c 3d 3e", "nodeFlags": [], "CurrentSensorStatus": "OPERATIONAL", "DeviceName": "", "CurrentElectricityFlow": "0.00", "CurrentElectricityQuantity": "5.00"}, 
    "dev_2.8": {"uuid": "88fc3dca-b996-4915-84a2-c778e0f29bdd", "name": "HAE_METER_v3_8", "internalAddress": "2.8", "type": "HAE_METER_v3_8", "supportsCrc": "0", "ccList": "5e 59 85 8e 3c 3d 3e", "supportedCC": "5e 59 85 8e 3c 3d 3e", "nodeFlags": [], "CurrentSensorStatus": "UNKNOWN", "DeviceName": "", "CurrentHeatQuantity": "NaN"}
}
hmmbob commented 5 years ago

Did some debugging myself and was able to map the keys to the correct values. Issue closed.