eriknn / ha-swegon

Swegon Modbus TCP/IP integration
Apache License 2.0
0 stars 0 forks source link

Not working with current release? #1

Open spjakob opened 4 days ago

spjakob commented 4 days ago

Was super happy to find this integration since I was just about to start writing my own for my Swegon R15H

image

...got this error when trying to install today. Any ideas?

eriknn commented 4 days ago

Cool, I released it as version 1.0.0 now, I think that might have helped! Note that I really just made this repo public so that I could add an icon in HASS Brands. Let me know if it works for you!

spjakob commented 2 days ago

image

Hmmm... just tried again in HACS... still same problem, maybe I'm doing something wrong?

Just curious also, what is the model you have tested with?

spjakob commented 2 days ago

Oh, last error was my misstake... I didn't realize I had to do a "update information" manuallt to make it download latest release... Will let you know any progress now that download worked... :)

spjakob commented 2 days ago

Ok, seems like installation went fine... Would be nice to add some information what to do next to get started. I assumed I only had to edit in right information in "const.py"? I added info for name, ip, port and slave. After this I restarted HA, but still no entities show up (or any other message/error/etc.). Any suggestions?

I use a different gateway, but I don't think that would be the problem... (?).

Long time since I programmed (anything), but is the config file used or there still hard coded constants in "config_flow.py" file?

BTW. Check my page for my email and send an email if you want. Ok to write in swedish if you are from here... ;)

eriknn commented 2 days ago

There are no hard-coded constants - configure the configuration with the "configure"-button....

Swegon

eriknn commented 2 days ago

Just FYI on the const-file which you edited: These constants are the keys (not values) which are used to store the different data. It’s common practice to save them like this, so we are sure that we are using the correct keys everywhere in the code. For instance, CONF_NAME = "name" means that there’s a dictionary that has a key called "name". This way I can save a name-value to myDataDict[CONF_NAME], and read it out the same way. I don’t need to remember if I called the key "name" or "username" or whatever - the IDE helps me fill it correctly, displays it in nice colors, and lets me know if the key doesn’t exist. I could use myDataDict["name"] as well, and it’d work, but you see why that’s bad coding… :)

spjakob commented 1 day ago

Thanks for clarification... not sure how I could have missed that obvious configure button..... I could swear it wasn't' there before... but anyway.... I had some success: image

...some numbers look a bit odd to me, but I guess that's maybe normal based on my setup. I was also expecting more data (based on pdf file from swegon), but when I pool manually with modbus tools, I don't get this data either. so this is probably not a problem with the integration...

Thanks for your a happy neighbour (country)! :)

eriknn commented 1 day ago

Great to hear! The drop down on "operation mode" has hardcoded norwegian values, sorry about that. Not sure how they can be translated, but I think they can! Your heat exchanger value is obviously wrong, it shoud probably be 100%? Can you check this value?

The temperature SP is probably not correct either, different scaling maybe?

eriknn commented 17 hours ago

I heavily modified the integration to allow for different models of the ventilation system, and I added a file for your R-15. I don't know what the values should be though - I suggest you select your model in the configuration, then try with different values in casa_r15.py Hopefully this change don't break anything 😱

spjakob commented 2 hours ago

Thanks a lot for the update! :) I will try out this as soon as I can. I will also talk to Swegon to find out if they could help me identify any values and I'm also a bit curios why I don't have anything for "software version etc". Is this available for your model?

Also since you modified this I have some thoughts/ideas for your program, but I will make a separate post about this right after this one...

spjakob commented 2 hours ago

First thanks again for your work on this.

Some background: I have a few modbus devices in my house now and there will be more coming soon. I have used the general "modbus" installation so far, adding configurations for every device and even for the same type of devices I have to repeat this in configuration file. As an example; I have three power meters and every one has close to 100 values; so to with this method I need to configure 3x100 values, each value require several lines. Same with temperature sensors... I have a few, each only support temperature and humidity, but still it becomes a big mess in the end. Also, another challenge is that for most devices I can (usually) find some documentation on how to get the values, but many times are there different variants (like we have now with two different Swegon devices) and time is needed to configure this. Also, the method I used doesn't work very well with writable values, or it needs to be implemented at least.

So why am I writing this to you? Well, I could not help after reading a little bit in the code, that I really think you had a program that was the embryo to the "HA modbus integration to rule them all" :) If the actual values/adress for devices moved to a configuraion file (tree) like this. swegon/r15-h.conf swegon/r9.conf swegon/r5.conf eastron/sdm630.conf trox/tve.conf grundfos/magna3.conf generic/abc.conf

it would be SOOO easy for new users to;

If successful, I think such an integration could replace ALL current HA integrations that talk to modbus devices.

I understand that this may not be what you want or plan to do, but I liked this idea so much that I just had to tell you. I hope your dont mind.

Unfortunately I'm not much of a programmer anymore and is right I just don't have the time to learn.... However, if you are interested I could maybe sponsor some cool modbus device, like the sdm630 :)

eriknn commented 2 hours ago

Yes I have that data: IMG_6530

spjakob commented 1 hour ago

Just to add clarify to above: I see a typical "new user" interaction like this.

  1. Add integration.
  2. Choose brand.
  3. Chose device and assign address.
  4. Repeat from 2/3. until every device is added.
  5. Be happy! :)
eriknn commented 1 hour ago

It makes sense to make one integration that supports similar devices - so this integration can support all Swegon-devices eventually. At least all Swegon CASA. Making it support any modbus device makes less sense. Having config files with the modbus-addresses is easy enough, but the integration also needs matching entity configuration for all the datapoints.

I’ll think about it though!

spjakob commented 1 hour ago

Thanks for the feedback. Either way I'll do my best to provide some feedback about my R15-H.

Off course a Swegon CASA unit has not much in common with a Eastron power meter from a functional point of view, but from a strict "HA - modbus perspective" it's close to identical work, except that entities have different names.

But I'll drop that now and will focus on getting some more information about my (and possibly other units) and I will contact Swegon next week to see if they can provide some more information about what values that it actually supports. I have only found some pdf that seems to be generic for all devices, but as we have found out there seem to be differences between them.

spjakob commented 1 hour ago

Just letting you know confirming latest localization changes working: :-) Don't know why my efficiency dropped to zero, but I think that happened before update....

image

eriknn commented 1 hour ago

Cool! Efficieny isn’t modbus parameter - it is calculated with extract temp, fresh air temp and supply temp before reheater. In your case the calculation is correct, but more or less «invalid» because the exchanger isn’t running..