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

⚖️ Simplify data model ⚖️ #90

Open
2 of 8 tasks
Terkwood opened this issue Jul 5, 2019 · 1 comment · May be fixed by #98
Open
2 of 8 tasks

⚖️ Simplify data model ⚖️ #90

Terkwood opened this issue Jul 5, 2019 · 1 comment · May be fixed by #98
Labels
enhancement New feature or request services.rs Middleware & data management written in rust

Comments

@Terkwood
Copy link
Owner

Terkwood commented Jul 5, 2019

Simplify data model

Description

This change set simplifies the flow of data so that we deal with two main abstractions:

  • devices which may hold arbitrary sensor reading data: temp, humidity, or PH
  • areas to which devices are attached

Sensor readings flow onto devices, and the devices being linked to individual areas drives the display in the LED status helper, and in the web app.

The introduction of the DHT11 sensor in #89 was done in a sloppy manner, introducing a dichotomy between "tanks" and "areas". "Tanks" are no longer tracked, they're just called "areas".

"Sensors" in Redis are renamed to "devices". This ends the distinction between a PH sensor, a temp sensor, or a DHT11 sensor. Every sensor reading simply attaches to a single Redis device record, so matter how many individual sensors are wired up to that device.

Components altered

  • sensor_tracker
  • redis_aggregator
  • pond
  • led_status_helper
  • frontend
  • ph_ref_calibration (be careful with the redis values!)

Testing strat

  • Use a testing namespace!
  • Pi: use images tagged as :fix_data on the build server 🔬

Branch info

We are working in the fix/data branch

@Terkwood Terkwood added enhancement New feature or request services.rs Middleware & data management written in rust labels Jul 5, 2019
@Terkwood Terkwood pinned this issue Jul 20, 2019
@Terkwood
Copy link
Owner Author

Instead of tracking "areas" and "tanks", just track "areas"

Instead of temp and ph sensors, track glob sensor readings under namespace/devices/<device-id> using the following hash fields:

  • temp_f
  • temp_c
  • ph
  • ph_mv
  • humidity
  • heat_index_(f¦c)
  • sensor_status (string)

@Terkwood Terkwood changed the title Data model: use "Sensor Group" in place of "Tanks" and "Areas" Simplify data model Jul 20, 2019
@Terkwood Terkwood changed the title Simplify data model 🔥 Simplify data model 🔥 Jul 20, 2019
@Terkwood Terkwood changed the title 🔥 Simplify data model 🔥 ⚖️ Simplify data model ⚖️ Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request services.rs Middleware & data management written in rust
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant