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

Add Boiler Percentage Demand in Climate #13

Closed
v966732 opened this issue Jan 11, 2019 · 7 comments
Closed

Add Boiler Percentage Demand in Climate #13

v966732 opened this issue Jan 11, 2019 · 7 comments
Assignees

Comments

@v966732
Copy link

v966732 commented Jan 11, 2019

I would like to request that Boiler Percentage Demand is added as one of the available stats in the Climate element. I was using an OpenHAB Wiser component and it had percentage demand as an option.

I have had a play with it and identified the string that is needed:-

return self.handler.getHubData().getRoom(self.roomId).get("PercentageDemand")

Thank-you

@asantaga
Copy link
Owner

asantaga commented Jan 11, 2019 via email

@asantaga
Copy link
Owner

asantaga commented Jan 12, 2019

Hey v966732

Done a lot here.

Ive added PCT_Demand to each room as a custom attribute AND at the heating state level. I noticed that he heating state is an array (because drayton sell it with 1-2-3 channels) so Ive modified this accordingly..

Please test and let me know.

easiest way to test is to simply clone the entire branch into your custom_components directory (I changed a number of files) and then move all the python files into the right locations...

Let me know if it all works and I'll merge it to master (probably up the version to 1.2)

@v966732
Copy link
Author

v966732 commented Jan 13, 2019

Hi,

Thank-you for all your work on this.

I downloaded the new code and tested it, the percentage demand worked straight away but current temperature and target/set temperature both disappeared from the climate component. I fiddled about with it and if I added target_temperature and current_temperature into the # Generic attributes section then I could read the values again. I'm not sure why this would be the case given that this is a climate component.

The amended Generic attributes section is as follows:-

#13

@property
def state_attributes(self):
    # Generic attributes
    attrs={}
    attrs['percentage_demand'] = self.handler.getHubData().getRoom(self.roomId).get("PercentageDemand")
    attrs['heating_rate'] = self.handler.getHubData().getRoom(self.roomId).get("HeatingRate")
    attrs['window_state'] = self.handler.getHubData().getRoom(self.roomId).get("WindowState")
    attrs['window_detection_active']= self.handler.getHubData().getRoom(self.roomId).get("WindowDetectionActive")
    attrs['away_mode_supressed']= self.handler.getHubData().getRoom(self.roomId).get("AwayModeSuppressed")
    attrs['target_temperature']= self.handler.getHubData().getRoom(self.roomId).get("CurrentSetPoint")/10
    attrs['current_temperature']= self.handler.getHubData().getRoom(self.roomId).get("CalculatedTemperature")/10




    return attrs 

Cheers

@asantaga
Copy link
Owner

asantaga commented Jan 13, 2019

tis a bit strange.. but I'll make the changes anyway..

I still have to create the ability to "set" temperatures, I'll do that at the same time (if I finish my accounts tonight)

whilst Im at it, are there any other values which would be of use?

@asantaga
Copy link
Owner

sorted, it was because i wasnt calling super and not executing the base code. fixed now
also pushed this to master as v1,2

@v966732
Copy link
Author

v966732 commented Jan 14, 2019

I've downloaded 1.2 and it all works fine, thank-you

@asantaga
Copy link
Owner

excellent :-) , gotta admit I was baffled by this , even adding your code didnt really do the trick so I investigated more.. Then lightbulb moment, by trade Im a java developer and when subclassing you always call the super.. so when I investigated that I realised this is precisely what I needed to do :-) So for me this bug helped me in many ways

Awesome stats too!!!

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