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

Edit Block Meter Bug #287

Closed
s-egge opened this issue Dec 28, 2023 · 2 comments · Fixed by #290
Closed

Edit Block Meter Bug #287

s-egge opened this issue Dec 28, 2023 · 2 comments · Fixed by #290

Comments

@s-egge
Copy link
Member

s-egge commented Dec 28, 2023

Some of the buildings appear to have duplicate/extra meters on the dropdown menu of the Edit Block

Buxton Hall

image
image

Buxton Electric is the default and only has Net Energy Usage (kWh) as a measurement

image
image

There are two "Buxton Electricity", both have all measurements in the drop down but only the third one works. The second one shows "No Data Available" for the measurements that I checked

McNary Hall

image

McNary has two Meters, both have all of the Measurements and all of them seem to work and are identical data

Dixon Rec Center

image
image

"Dixon Rec Center" is the default and has all of the measurements. "Dixon Recreation Center" only has one and throws an error when attempting to use it.

image
image
image

When switching the meter to Dixon Steam, the Measurement auto-fills as accumulated_real which will cause issues if it's not changed manually to one of the drop-down options.

This is not exhaustive, though most of the other residence halls that I checked appear to behave normally.

@solderq35
Copy link
Contributor

solderq35 commented Dec 31, 2023

Summary of Findings

Buxton

  • Top 2 meter groups on Edit Menu include meter ID 38 which reports no data (refer to Browser Debug section below), which is probably why the Measurements (points) menu is bugged for those 2

McNary

  • From what I can tell these are 2 different meter groups that both have the same meter (meter ID 6) in it. Valid data, just redundant

Dixon

  • "Dixon Recreation Center" Meter Group calls meter ID's 5 and 7. Since one of these is Electricity and the other Steam, that's why it is bugged
  • For "Dixon Steam", you're correct that there seems to be a frontend bug with meters of incompatible energy types showing up in the Edit Menu when they shouldn't, could be something to fix in the future
    • Also seems to be the case for other buildings with multiple energy types, e.g. Student Experience Center, Nash

Fixes

Buxton / McNary

(and any other similar issue buildings)

  • After double checking that the meter group is either invalid or redundant, you can just delete the meter groups in question from the database, or if you're not sure, just change the building_id_2 column of the meter group to NULL or something
    • delete * from meter_groups where id = <meter id value>

Dixon

  • Probably a more long-term frontend PR needed, starting with edit_card.vue

References

Browser Debug Network Tab

  • Other than changing the meter group in the meter menu dropdown, you can also change the "from" or "to" dates to force the API requests to send again (helpful for the default meter group)
  • Remember, these are technically meter groups, so some options on the Edit form may result in multiple API requests being sent
  • In the case of Dixon, "Dixon Recreation Center" meter group sends requests to meter ID's 5 and 7. As shown in Network debug tab, meter 7 is defunct (more on this below). See screenshot
    image

AllBuildings API Call

MySQL Workbench

  • See https://osu-sustainability-office.github.io/docs/database#relationships-between-tables
  • Generally clunkier than the AllBuildings API call, but:
    • select * from meter_groups (reference building_id_2 column for buildings table foreign key)
    • select * from meter_group_relation (meter to meter_group relationships)
    • select * from data where meter_id = 38 order by time DESC; (example meter ID, useful to see when last valid data is from)

@s-egge
Copy link
Member Author

s-egge commented Dec 31, 2023

SQL DB Changes

I used MySQL to select * from meter_groups, then sorted by building_id_2 in order to look for duplicate building IDs with duplicate names (like Buxton Hall and Buxton Hall Electric). After confirming via the Energy Dashboard which were actually duplicates or which had no data, I set the building_id_2 to null for now to make sure there aren't any adverse effects before deleting them.

There were changes in 4 buildings:

  • Buxton

    • meter_group IDs 63 and 152 building_id_2 set to null
    • meter_group ID 63 set default to 0 (page was no longer loading after setting the building_id_2 to null
    • meter_group ID 153 set default to 1 (63 was originally the default and had valid data, but only one meter, whereas 153 has all of the meters)
  • McNary Hall

    • meter_group ID 13 building_id_2 set to null
  • McNary Dining Hall

    • meter_group ID 12 building_id_2 set to null
  • Dixon Recreation Center

    • meter_group ID 14 building_id_2 set to null

@s-egge s-egge linked a pull request Dec 31, 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
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants