ek5932 / jg_aura_ha

John Guest Aura integration for home assistant
1 stars 1 forks source link

Node ids don't seem reliable for extracting thermostat information #1

Open WasserX opened 1 year ago

WasserX commented 1 year ago

Hi, first of all, thank you for this great contribution! It was a big gap in my setup :)

I tried using the component, but I found that the node ids that are set in the code do not actually appear in the response from my system. I did a couple of modifications and I'm happy to open a PR if you're OK with it, hopefully they also work in your setup.

What have I done?

Again, as you can see there are quite a few changes that I'm proposing. Happy to discuss them further and/or open a PR if you would like.

ek5932 commented 1 year ago

Hey, thanks for the post. Please open a PR and I'll test your changes against my setup. Most of what I have working was based on some other examples I found on the net which was looking at specific nodes to interpret the devices statuses. It worked fine with my setup but when I extended the code to support hot water I noticed that the node values wouldn't always be the same, so I'm not entirely surprised it didn't work without some tweaking.

As for the run modes, I only really left in what I needed (I only use Low, High & Away) as I didn't think anyone else would actually use what I had done but I'm happy to reintroduce all the available options.

I never really used the Away/Party functionality in the JG app itself so I'm not entirely sure how they function but I essentially use Away as a status in HA to track which thermostats are scheduled to be on when I'm not in the house. It simplifies the state management, so for example in the morning if a thermostat is scheduled to turn on but no one is in the house it will go into an Away state. If I then come back home, rather then trying to be smart about which thermostats are scheduled to be turned on now I have returned, I set everything which currently has an Away status to High.

On a final note, the high refresh rates were due to an earlier iteration of the code not updating the mode/temperatures in HA after making changes. I originally thought I was doing something wrong in HA but managed to fix the bug in the JG client code now so it's reliable, so having a configurable interval makes sense. Again, I didn't actually think anyone would actually use this :)

I look forward to seeing the changes in your PR. If anything, me adding this was in hope of someone else contributing to make it better!