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

Lightning Sensor Distance hardcoded to km #32

Closed
wy1d opened this issue Jul 12, 2023 · 0 comments · Fixed by #33
Closed

Lightning Sensor Distance hardcoded to km #32

wy1d opened this issue Jul 12, 2023 · 0 comments · Fixed by #33
Labels
bug Something isn't working

Comments

@wy1d
Copy link

wy1d commented Jul 12, 2023

Integration Version:
v1.12

Home Assistant Version:
core-2023.7.1

Describe the bug
Lightning Sensor provides distance data in km and cannot be changed to miles through the UI like other distance-based entities. The integration is missing the device_class:distance attribute.

To Reproduce
Steps to reproduce the behavior:

  1. Navigate to Lightning Sensor Distance
  2. Click on Gear Icon
  3. See unit of measurement dropdown is missing.

Expected behavior
User should be able to choose the reported distance unit. Other device_class:distance entities offer several distance measurements including km, mi (and also meters, feet, yards, etc...)

Screenshots
awnet_local integration sensor entity:
image (1)

other entity with device_class:distance attribute giving Unit of Measurement option:
image (2)

Debug log output from the integration (see Home Assistant docs for how to enable debug logging for an integration; integration name: "custom_components.awnet_local")

2023-07-11 23:10:52.619 DEBUG (MainThread) [custom_components.awnet_local] Called async_handle_update with <ServiceCall awnet_local.update (c:01H541926AZBJMTF2AS6YKPZZW): stationtype=AMBWeatherPro_V5.0.6, PASSKEY=[REDACTED], dateutc=2023-07-12 03:10:52, tempf=69.8, humidity=91, windspeedmph=0.00, windgustmph=0.00, maxdailygust=6.93, winddir=301, winddir_avg10m=301, uv=0, solarradiation=0.00, hourlyrainin=0.000, dailyrainin=0.000, weeklyrainin=0.449, monthlyrainin=0.500, yearlyrainin=23.193, battout=1, tempinf=74.5, humidityin=51, baromrelin=30.002, baromabsin=28.931, battin=1, pm25=12.0, pm25_24h=8.7, aqi_pm25=50, aqi_pm25_24h=36, batt_25=1, soilhum1=90, battsm1=1, lightning_day=0, lightning_time=1688955507, lightning_distance=14, batt_lightning=0, pm_in_temp_aqin=74.8, pm_in_humidity_aqin=53, pm10_in_aqin=1.4, pm10_in_24h_aqin=1.6, pm25_in_aqin=1.0, pm25_in_24h_aqin=1.1, co2_in_aqin=597, co2_in_24h_aqin=757, aqi_pm25_aqin=4, aqi_pm25_24h_aqin=5, batt_co2=1>
2023-07-11 23:10:52.627 INFO (MainThread) [custom_components.awnet_local] Last data: {'MAC': '[REDACTED]', 'name': '[REDACTED]', 'last_data': {'dateutc': '2023-07-12 03:10:35', 'tempf': '69.8', 'humidity': '91', 'windspeedmph': '0.00', 'windgustmph': '0.00', 'maxdailygust': '6.93', 'winddir': '301', 'uv': '0', 'solarradiation': '0.00', 'hourlyrainin': '0.000', 'dailyrainin': '0.000', 'weeklyrainin': '0.449', 'monthlyrainin': '0.500', 'yearlyrainin': '23.193', 'battout': '1', 'tempinf': '74.5', 'humidityin': '51', 'baromrelin': '30.002', 'baromabsin': '28.931', 'battin': '1', 'pm25': '12.0', 'pm25_24h': '8.7', 'aqi_pm25': '50', 'aqi_pm25_24h': '36', 'batt_25': '1', 'soilhum1': '90', 'battsm1': '1', 'lightning_day': '0', 'lightning_time': '1688955507', 'lightning_distance': '14', 'batt_lightning': '0', 'pm10_in_aqin': '1.4', 'pm10_in_24h_aqin': '1.6', 'pm25_in_aqin': '1.0', 'pm25_in_24h_aqin': '1.1', 'batt_co2': '1'}, 'known_sensors': ['aqi_pm25', 'lightning_hour', 'dateutc', 'tempinf', 'baromrelin', 'dewPoint', 'battout', 'winddir', 'pm25', 'lightning_day', 'pm25_24h', 'maxdailygust', 'windgustmph', 'uv', 'aqi_pm25_24h', 'tempf', 'feelsLike', 'lightning_distance', 'humidityin', 'pm25_in_24h_aqin', 'feelsLikein', 'soilhum1', 'yearlyrainin', 'battin', 'dewPointin', 'windspeedmph', 'baromabsin', 'dailyrainin', 'batt_co2', 'solarradiation_lx', 'weeklyrainin', 'batt_25', 'lastRain', 'lightning_time', 'pm25_in_aqin', 'pm10_in_aqin', 'solarradiation', 'batt_lightning', 'pm10_in_24h_aqin', 'monthlyrainin', 'humidity', 'hourlyrainin', 'battsm1'], 'lightning_data': {'1689127848.0': 0, '1689127865.0': 0, '1689127882.0': 0, '1689127899.0': 0, '1689127916.0': 0, '1689127933.0': 0, '1689127950.0': 0, '1689127967.0': 0, '1689127984.0': 0, '1689128001.0': 0, '1689128018.0': 0, '1689128035.0': 0, '1689128052.0': 0, '1689128069.0': 0, '1689128086.0': 0, '1689128103.0': 0, '1689128120.0': 0, '1689128137.0': 0, '1689128154.0': 0, '1689128171.0': 0, '1689128188.0': 0, '1689128205.0': 0, '1689128222.0': 0, '1689128239.0': 0, '1689128256.0': 0, '1689128273.0': 0, '1689128290.0': 0, '1689128307.0': 0, '1689128324.0': 0, '1689128341.0': 0, '1689128358.0': 0, '1689128375.0': 0, '1689128392.0': 0, '1689128409.0': 0, '1689128426.0': 0, '1689128443.0': 0, '1689128460.0': 0, '1689128477.0': 0, '1689128494.0': 0, '1689128511.0': 0, '1689128528.0': 0, '1689128545.0': 0, '1689128562.0': 0, '1689128579.0': 0, '1689128596.0': 0, '1689128613.0': 0, '1689128630.0': 0, '1689128647.0': 0, '1689128664.0': 0, '1689128681.0': 0, '1689128698.0': 0, '1689128715.0': 0, '1689128732.0': 0, '1689128749.0': 0, '1689128766.0': 0, '1689128783.0': 0, '1689128800.0': 0, '1689128817.0': 0, '1689128834.0': 0, '1689128851.0': 0, '1689128868.0': 0, '1689128885.0': 0, '1689128902.0': 0, '1689128919.0': 0, '1689128936.0': 0, '1689128953.0': 0, '1689128970.0': 0, '1689128987.0': 0, '1689129004.0': 0, '1689129021.0': 0, '1689129038.0': 0, '1689129055.0': 0, '1689129072.0': 0, '1689129089.0': 0, '1689129106.0': 0, '1689129123.0': 0, '1689129140.0': 0, '1689129157.0': 0, '1689129174.0': 0, '1689129191.0': 0, '1689129208.0': 0, '1689129225.0': 0, '1689129242.0': 0, '1689129259.0': 0, '1689129276.0': 0, '1689129293.0': 0, '1689129310.0': 0, '1689129327.0': 0, '1689129344.0': 0, '1689129361.0': 0, '1689129378.0': 0, '1689129395.0': 0, '1689129412.0': 0, '1689129429.0': 0, '1689129446.0': 0, '1689129463.0': 0, '1689129480.0': 0, '1689129497.0': 0, '1689129514.0': 0, '1689129531.0': 0, '1689129548.0': 0, '1689129565.0': 0, '1689129582.0': 0, '1689129599.0': 0, '1689129616.0': 0, '1689129633.0': 0, '1689129650.0': 0, '1689129667.0': 0, '1689129684.0': 0, '1689129701.0': 0, '1689129718.0': 0, '1689129735.0': 0, '1689129752.0': 0, '1689129769.0': 0, '1689129786.0': 0, '1689129803.0': 0, '1689129820.0': 0, '1689129837.0': 0, '1689129854.0': 0, '1689129871.0': 0, '1689129888.0': 0, '1689129905.0': 0, '1689129922.0': 0, '1689129939.0': 0, '1689129956.0': 0, '1689129973.0': 0, '1689129990.0': 0, '1689130007.0': 0, '1689130024.0': 0, '1689130041.0': 0, '1689130058.0': 0, '1689130075.0': 0, '1689130092.0': 0, '1689130109.0': 0, '1689130126.0': 0, '1689130143.0': 0, '1689130160.0': 0, '1689130177.0': 0, '1689130194.0': 0, '1689130211.0': 0, '1689130228.0': 0, '1689130245.0': 0, '1689130262.0': 0, '1689130279.0': 0, '1689130296.0': 0, '1689130313.0': 0, '1689130330.0': 0, '1689130347.0': 0, '1689130364.0': 0, '1689130381.0': 0, '1689130398.0': 0, '1689130415.0': 0, '1689130432.0': 0, '1689130449.0': 0, '1689130466.0': 0, '1689130483.0': 0, '1689130500.0': 0, '1689130517.0': 0, '1689130534.0': 0, '1689130551.0': 0, '1689130568.0': 0, '1689130585.0': 0, '1689130602.0': 0, '1689130619.0': 0, '1689130636.0': 0, '1689130653.0': 0, '1689130670.0': 0, '1689130687.0': 0, '1689130704.0': 0, '1689130721.0': 0, '1689130738.0': 0, '1689130755.0': 0, '1689130772.0': 0, '1689130789.0': 0, '1689130806.0': 0, '1689130823.0': 0, '1689130840.0': 0, '1689130857.0': 0, '1689130874.0': 0, '1689130891.0': 0, '1689130908.0': 0, '1689130925.0': 0, '1689130942.0': 0, '1689130959.0': 0, '1689130976.0': 0, '1689130993.0': 0, '1689131010.0': 0, '1689131027.0': 0, '1689131044.0': 0, '1689131061.0': 0, '1689131078.0': 0, '1689131095.0': 0, '1689131112.0': 0, '1689131129.0': 0, '1689131146.0': 0, '1689131163.0': 0, '1689131180.0': 0, '1689131197.0': 0, '1689131214.0': 0, '1689131231.0': 0, '1689131248.0': 0, '1689131265.0': 0, '1689131282.0': 0, '1689131299.0': 0, '1689131316.0': 0, '1689131333.0': 0, '1689131350.0': 0, '1689131367.0': 0, '1689131384.0': 0, '1689131401.0': 0, '1689131418.0': 0, '1689131435.0': 0}, 'sensor_update_in_progress': False, 'stationtype': 'AMBWeatherPro_V5.0.6'}
2023-07-11 23:10:52.628 INFO (MainThread) [custom_components.awnet_local] Processing data
2023-07-11 23:10:52.628 INFO (MainThread) [custom_components.awnet_local] MAC address: [REDACTED]
2023-07-11 23:10:52.628 DEBUG (MainThread) [custom_components.awnet_local] New data received: {'stationtype': 'AMBWeatherPro_V5.0.6', 'PASSKEY': '[REDACTED]', 'dateutc': '2023-07-12 03:10:52', 'tempf': '69.8', 'humidity': '91', 'windspeedmph': '0.00', 'windgustmph': '0.00', 'maxdailygust': '6.93', 'winddir': '301', 'winddir_avg10m': '301', 'uv': '0', 'solarradiation': '0.00', 'hourlyrainin': '0.000', 'dailyrainin': '0.000', 'weeklyrainin': '0.449', 'monthlyrainin': '0.500', 'yearlyrainin': '23.193', 'battout': '1', 'tempinf': '74.5', 'humidityin': '51', 'baromrelin': '30.002', 'baromabsin': '28.931', 'battin': '1', 'pm25': '12.0', 'pm25_24h': '8.7', 'aqi_pm25': '50', 'aqi_pm25_24h': '36', 'batt_25': '1', 'soilhum1': '90', 'battsm1': '1', 'lightning_day': '0', 'lightning_time': '1688955507', 'lightning_distance': '14', 'batt_lightning': '0', 'pm_in_temp_aqin': '74.8', 'pm_in_humidity_aqin': '53', 'pm10_in_aqin': '1.4', 'pm10_in_24h_aqin': '1.6', 'pm25_in_aqin': '1.0', 'pm25_in_24h_aqin': '1.1', 'co2_in_aqin': '597', 'co2_in_24h_aqin': '757', 'aqi_pm25_aqin': '4', 'aqi_pm25_24h_aqin': '5', 'batt_co2': '1'}
2023-07-11 23:10:52.629 DEBUG (MainThread) [custom_components.awnet_local] Known calc'd sensor types: ['lastRain', 'feelsLike', 'dewPoint', 'solarradiation_lx', 'feelsLikein', 'dewPointin', 'lightning_hour']
2023-07-11 23:10:52.630 DEBUG (MainThread) [custom_components.awnet_local] New sensors to add: []
2023-07-11 23:10:52.653 DEBUG (MainThread) [custom_components.awnet_local.helpers_calc] Closest time to 2023-07-12 02:10:52+00:00 determined to be 2023-07-11 22:10:48
2023-07-11 23:10:52.655 DEBUG (MainThread) 

@wy1d wy1d added the bug Something isn't working label Jul 12, 2023
@tlskinneriv tlskinneriv linked a pull request Jul 13, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant