-
Notifications
You must be signed in to change notification settings - Fork 13
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
Various sensor fixes #34
base: master
Are you sure you want to change the base?
Conversation
Correctly assign SensorEntityDescription to the correct attribute. This fixes long term statistics (state_class correctly recorded) and removes the need for overriding some properties. With the fixed SensorEntityDescription we have a malconfigured power sensor however. Assuming the state class is supposed to be measurement, the sensor device class probably needs to be POWER with the unit being WATT. For some reason, the energy sensor was constructed if the temperature is available int he state value. Probably it should depend on the power, not temperature (same as the power sensor). The energy sensor also had two conflicting sensor states configured (total and total increasing). Stuck with the latter for now, removed the former. Made the power calculation a bit more robust as well
This change will conflict slightly with #31 (contains some of those changes). Furthermore, I'm making some asusmptions here about the power sensor, which I would need help validating as my rctouch'es don't consume power. Since there's both a power and an energy sensor defined, I would assume the power should report power consumption and energy report energy consumption. As it was, both were device class energy. Chaning that, the unit also needed changing to watt. Is this correct? I have no idea.. However, with my changes the state_class is correctly registered and measurement is not compatible with watt hour. So it either needs to be watt and measurement (and probably energy), or watt hour and increasing/total increasing (and senor type power, but then we have two power sensors..). The power sensor entity name also seems wrong, but changing it now would be a breaking change? So I did not change it. Appreciate if someone with actual power consumption could validate this change and see if it makes sense or not. |
@alex-w2 Thank you for your respons. vh Gunnar |
@gunmalmg I'm not sure how you installed the addon initially (throught HACS or directly from github?), but you'd have to manually install the version on this branch from my fork into custom_components and then restart the addon/home assistant. If you want to give it a shot, make sure to do a backup beforehand, in case things go wrong. |
@alex-w2 I ‘not that skilled to safely do that kind of testing. I can manage to download beta versions through HACS. Regards Gunnar |
We can perhaps use a custom hacs repository, let me look into it in the weekend. |
@gunmalmg you should be able to add my repository (https://github.com/alex-w2/ha-xcomfort-bridge/) as a custom repository in HACS now, then install the latest version from there. This version contains both PRs #34 and #35. |
Thanks, I'll check it out.
Med vennlig hilsen
*Horisont Eiendom AS <https://tingsakertorv.no/horisont-eiendom> /
Lillesand Senter <http://lillesandsenter.no> / Agder Helsepark
<https://tingsakertorv.no/forside-helse> / Tingsaker Torv
<https://tingsakertorv.no/om-tingsaker-torv> / Horisont Utvikling
<https://tingsakertorv.no/om-tingsaker-torv>*
*Gunnar Malmgård*
Tlf: 91686522,
***@***.***
Senterveien 30, 4790 Lillesand
søn. 6. okt. 2024 kl. 21:59 skrev Alex W ***@***.***>:
… @gunmalmg <https://github.com/gunmalmg> you should be able to add my
repository (https://github.com/alex-w2/ha-xcomfort-bridge/) as a custom
repository in HACS now, then install the latest version from there. This
version contains both PRs #34
<#34> and #35
<#35>.
—
Reply to this email directly, view it on GitHub
<#34 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A6ULHF2ZQHXA3SEUWGO7NE3Z2GJBNAVCNFSM6AAAAABPBSZ7POVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJVGU3DINZVGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hello! I hope we will get all these latest PRs working and merged into the master branch as soon as possible. *Edit: Simple error to fix, just missing a , in line 24 of sensor.py, this was on the version that i installed via HACS. |
Sorry about that, fixed and pushed a new release now at https://github.com/alex-w2/ha-xcomfort-bridge |
I can cleanup the readme a bit later perhaps, however, not really planning for my repo to become the main repo here. Goal is to merge upstream to here 😄 |
Yes, your changes to power sensor makes sense. It shows power as Watt, and it it the same value as the Eaton app shows. And yes, it would be nice if the sensors had a more describabale name. |
Tried adding it, but returns:
Looks like this depends on https://github.com/jankrib/xcomfort-python, so just installing through HACS without incl dependencies wont work |
@javydekoning Did you install via HACS? It does depend on https://github.com/jankrib/xcomfort-python, but this should be handled automatically if installed through HACS (it's listed in the manifest). At least it worked when I test installed from HACS. If you downloaded the integration manually you'll need to satisfy the dependency yourself (install it or download it to somewhere in the Python modules path). |
Yes, I did install via HACS. Dependency didn't install. |
@javydekoning Not sure what the issue is, I tested again on a fresh HA instance (container) by installing HACS and then installing the xComfort bridge integration from my custom repository. It worked fine. I can tell that the xcomfort module was installed by running "pip list" in a terminal. Can you try manually installing the xcomfort via pip in a terminal? |
I'm using Tried both the master branch and /config # pip list | grep -i pycryptodome
pycryptodome 3.21.0
pycryptodomex 3.21.0
/config # pip list | grep -i rx
pyRFXtrx 0.31.1
Rx 3.2.0
rxv 0.7.0
/config # pip list | grep -i xcomfort
/config # If I manually |
@javydekoning I'm out of ideas, this is not really my area of expertise unfortunately. I just threw something together quickly to let people test while we wait. |
Hi
I only have a Bridge that is used in a commercial building. So I don't
have the opportunity to do "faulty" testing on that- I'm sorry.
Med vennlig hilsen
*Horisont Eiendom AS <https://tingsakertorv.no/horisont-eiendom> /
Lillesand Senter <http://lillesandsenter.no> / Agder Helsepark
<https://tingsakertorv.no/forside-helse> / Tingsaker Torv
<https://tingsakertorv.no/om-tingsaker-torv> / Horisont Utvikling
<https://tingsakertorv.no/om-tingsaker-torv>*
*Gunnar Malmgård*
Tlf: 91686522,
***@***.***
Senterveien 30, 4790 Lillesand
søn. 20. okt. 2024 kl. 11:53 skrev Alex W ***@***.***>:
… @olegje <https://github.com/olegje>, @gunmalmg
<https://github.com/gunmalmg> Is it working for you?
—
Reply to this email directly, view it on GitHub
<#34 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A6ULHF4YMMQNPYLXPHH3RILZ4N4R3AVCNFSM6AAAAABPBSZ7POVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRUG44TINJXGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I have tested this in the devcontainer. It works there and installs the dependency. Not sure why it's different in my running install, but I'll keep digging. |
Had some more time to spend on this, still face the same with a completely vanilla install of home-assistant. Using: Debug logs enabled:
Config file used:
I've added a logging statement in the custom component
Not sure how this should work for customer components. Reached out on ha forums for support: https://community.home-assistant.io/t/custom-component-development-loading-python-dependencies/792381 |
Correctly assign SensorEntityDescription to the correct attribute. This fixes long term statistics (state_class correctly recorded) and removes the need for overriding some properties.
With the fixed SensorEntityDescription we have a malconfigured power sensor however. Assuming the state class is supposed to be measurement, the sensor device class probably needs to be POWER with the unit being WATT.
For some reason, the energy sensor was constructed if the temperature is available int he state value. Probably it should depend on the power, not temperature (same as the power sensor).
The energy sensor also had two conflicting sensor states configured (total and total increasing). Stuck with the latter for now, removed the former.
Made the power calculation a bit more robust as well