-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
Add missing UoMs #597
base: main
Are you sure you want to change the base?
Add missing UoMs #597
Conversation
Thanks. Have you tested these changes and you confirm it works? I'm not completely sure that humidity is dimensionless either - it's a percentage so probably should be a PercentType don't you think?. |
Tested it on my setup, works fine. As far as I understand, |
I think you are getting mixed up. Remember, bindings know nothing about items - we only care about Relative humidity is defined in percentage - I think this should be therefore a |
Yet the xml entry is called
Absolutely willing to go with the best option, but I see similar configuration also in other bindings (https://github.com/openhab/openhab-addons/blob/2.5.x/bundles/org.openhab.binding.openweathermap/src/main/resources/ESH-INF/thing/channel-types.xml#L232). Let's wait for external help, I'll try |
Yes, I was getting at the states that the binding uses - the two are obviously linked 👍 Really this should be a system channel so that everyone does the same thing rather than choosing a random binding to align with. I'm a bit loath to change just for the sake of it - the best option really would be to have a "full set" of common system channels so that everyone is 100% aligned. |
Anyway, I see the other point now - the |
Ok, but I don't want to randomly change this. Currently this will work fine and I don't really see the need to just change this. What is the actual problem? If I search through the Addons repo, there is a split of different channel configrations for humidity and I would suggest that we should make a system channel, and change this once - not twice. I should say - I'm happy enough with illuminance - that's clearer. |
I see - I will remove the changes to RH and wait for a better implementation, then. |
Signed-off-by: Giuseppe Iannello <giuseppe.iannello@brokenloop.net>
Signed-off-by: Giuseppe Iannello <giuseppe.iannello@brokenloop.net>
Signed-off-by: Giuseppe Iannello <giuseppe.iannello@brokenloop.net>
Rebased, found and fixed a few channels that were not correctly initialized. |
Did these changes require you to redefine your items to the new type? |
The channels need to be re-discovered, in order to show the new type. I don't have any manually-defined item. The Things linked to those channels will keep on working without changes (and without UoM) until their type is properly defined, due to automagic conversion. |
Thanks. That's what I thought. I think we should park this for now and possibly add it in the OH3 branch which should be coming soon. Otherwise we break everyones system and require them to rediscover everything. |
Fine for me. On a side note, I've checked multiple bindings dealing with humidity, and all of them are using |
Thanks. Yes, I also did a search so I concur. I still think it would be good to add this to system channels so I might look at that for OH3. |
@giannello I've rebased this as we discussed a while back, and we now have some merge conflicts. Please can you take a look and update accordingly. |
There is actually a system channel for humidity in percentage: https://www.openhab.org/docs/developer/bindings/thing-xml.html#system-state-channel-types |
Hi all, what is needed to finish this out? I also have a local commit changing relative humidity to Should we maintain our own channel type for humidity and just change the definition (and converter) to use |
I don't think it needs any major changes - just rebasing and resolving issues. The big problem is this will break everyones system which is less nice. If we're going to break everything, we might as well use the system channel for humidity. Humidity is humidity - indoors and outdoors so there shouldn't be different channel types. |
Oddly, there is a system type for temperature but it explicitly says "Outdoor Temperature". That's where my concern was rooted. Otherwise I would say wholesale we should adopt those types across the board including for temperature. |
IMHO "channel types" should be abstract enough to be reusable - so "temperature" is a channel type. The "channel" can then be of type "temperature", and called "indoor temperature" or "outdoor temperature" - or "water temperature" - who knows. We shouldn't have types for every possible place someone might want to measure a temperature... Anyway, that's a core problem. I added the ability to customise type labels a long time ago (in ESH) for the Zigbee and ZWave bindings to provide this separation between channel types and the actual channels, but I guess this is not being used. For Zigbee I prefer not to stick with generic types. I don't care too much about the label being used in the type as that can be customised in the channel definition. |
I opened a new PR in #765. For now I pushed up the humidity channel as I have it currently implemented, but we can continue discussion there/change as necessary. |
Add missing
item-type
qualification for illuminance and humidity