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

Allow Meter ID to be stored in secrets.yaml #178

Open
ayourk opened this issue Nov 15, 2022 · 3 comments
Open

Allow Meter ID to be stored in secrets.yaml #178

ayourk opened this issue Nov 15, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@ayourk
Copy link

ayourk commented Nov 15, 2022

It would be great to be able to do something like the following in secrets,yaml and then use that in the config to hide the meter IDs in the main config.

--- secrets.yaml ---
meter_elec: 10528282
meter_gas: 52212210
meter_water: 3223125100


The numbers above are random numbers I created in the moment and are not reflective of an exact meter ID; they are used as examples only.

- id: !secret meter_elec 
  protocol: scm
  name: meter_electricity
  format: "#####.##"
  unit_of_measurement: kWh
  icon: mdi:lightning-bolt
  device_class: energy
  state_class: total_increasing
  filters:
    - multiply: 0.01
- id: !secret meter_gas
  protocol: scm
  name: meter_gas
  format: "####.###"
  unit_of_measurement: ft³
  icon: mdi:gas-meter
  device_class: gas
  state_class: total_increasing
  filters:
    - multiply: 0.001
- id: !secret meter_water
  protocol: r900
  name: meter_water
  format: "#######.#"
  unit_of_measurement: gal
  icon: mdi:water
  device_class: water
  state_class: total_increasing
  filters:
    - multiply: 0.1

Please note: If you want to add Gas or Water to the Energy Dashboard, you MUST change the units to m³. Once added to the energy dashboard, the units can be changed back.

@allangood allangood added the enhancement New feature or request label Nov 17, 2022
@onedr0p
Copy link

onedr0p commented Dec 18, 2023

Another improvement to this would to also be able to support injecting env like home assistant supports. e.g.

- id: !env_var METER_ID
  protocol: r900
  name: meter_water
  format: "#######.#"
  unit_of_measurement: gal
  icon: mdi:water
  device_class: water
  state_class: total_increasing
  filters:
    - multiply: 0.1

@PrplHaz4
Copy link
Contributor

Either of these methods for pulling Meter IDs out of the primary config would work for me.

Please note: If you want to add Gas or Water to the Energy Dashboard, you MUST change the units to m³. Once added to the energy dashboard, the units can be changed back.

Can you elaborate on this one? I've been wondering why my water units aren't showing up in the Energy Dashboard - they are currently in ft³. Something like this?

  1. Change the units to m³ in rtlamr2mqtt, restart rtlamr2mqtt
  2. Restart homeassistant, see them on the dashboard
  3. Reset units back to ft³ in rtlamr2mqtt, restart rtlamr2mqtt
  4. Restart homeassistant, see them on the dashboard

@ayourk
Copy link
Author

ayourk commented Dec 18, 2023

Here is a link to the start of the conversation where I started getting the Gas section nailed down in the Home Assistant Discord, #energy channel: https://discord.com/channels/330944238910963714/872496321574088765/1041881869958004837

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants