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

Combining Sensors #33

Open
behold81 opened this issue Nov 12, 2022 · 3 comments
Open

Combining Sensors #33

behold81 opened this issue Nov 12, 2022 · 3 comments

Comments

@behold81
Copy link

Is it possible to combine sensors by name to there main item?

E.G. where you have an power monitored outlet. The main outlet has sub entities of Watts, voltage, amps. Instead of being separate entities.

Would fix some integrations with energy dashboard.

@brettonw
Copy link
Contributor

brettonw commented Nov 12, 2022 via email

@behold81
Copy link
Author

I have done this. Created them as helpers. But I think it's moaning that amps or voltage are missing to complete the calculations. Maybe it's something else.

I could be wrong.

Either way you are right they are entities but should they not be a sub of a device which is the outlet. Apex mor at the integration level?

Just thinking out loud.

BTW. Loving having this integration.

@brettonw
Copy link
Contributor

For reference, here is my yaml (rename according to your entities):

template:
  sensor:
    - name: "Aquarium Power"
      unique_id: "aquarium_power_w"
      unit_of_measurement: "W"
      device_class: "power"
      state: >
        {% set w1 = (states('sensor.apex_light1_2_1w') | float) %}
        {% set w2 = (states('sensor.apex_light2_2_2w') | float) %}
        {% set w3 = (states('sensor.apex_retpump_2_3w') | float) %}
        {% set w4 = (states('sensor.apex_reflight_2_4w') | float) %}
        {% set w5 = (states('sensor.apex_skimmer_2_5w') | float) %}
        {% set w6 = (states('sensor.apex_dos_2_6w') | float) %}
        {% set w7 = (states('sensor.apex_heater_2_7w') | float) %}
        {% set w8 = (states('sensor.apex_pwrhead_2_8w') | float) %}
        {{ w1 + w2 + w3 + w4 + w5 + w6 + w7 + w8 }}

Just to answer your question from the HA perspective, the entire Apex is the device.

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

No branches or pull requests

2 participants