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

Ability to turn TRV off #3

Closed
msp1974 opened this issue Dec 15, 2019 · 14 comments
Closed

Ability to turn TRV off #3

msp1974 opened this issue Dec 15, 2019 · 14 comments

Comments

@msp1974
Copy link
Collaborator

msp1974 commented Dec 15, 2019

Hi,

Hope you don't mind these issues and appreciate input to this great HA integration.

One of the things that seems to be missing from the api is the ability to turn off a TRV, ie set to manual mode and set temp to -200.

I am thinking that if in setRoomMode if it should accept an 'off' mode which would have the following patchData

       patchData={"Mode":"Manual","RequestOverride":{"Type":"Manual","SetPoint":-200}}

I have tested this with both postman and adding into the api and it seems to work.

The only issue I am not sure how to resolve is that if you then put it back to manual mode, the temp is still set to -200 and cannot be adjusted through lovelace thermostat card. I have, for now, done it so that when setting manual mode it uses the patchData above but uses the boost temp. I think it should have some logic to determine the temp set point when setting manual mode (current setpoint if coming from auto mode and some pre-determined setpoint if coming from off mode) or the ability to pass in the setpoint temp when going to manual.

What do you think?
Mark

@asantaga
Copy link
Owner

Hey loving the input.. :-)

WRT the issue of resetting the temperature back to auto, with the right temp . Alas I know what the api call is for querying the schedule- must be possible as the app on the phone does this.. If we move the trv from manual to auto all we'd need to do is query the schedule and work out what the temperature would be..

I'll have a nose later..

(Gotta get a white paper out today :-( )

@msp1974
Copy link
Collaborator Author

msp1974 commented Dec 16, 2019

The issue is more going from off to manual. If you set from off back to auto, the schedule set point is set by the wiser hub. I think the challenge is that if you go from off to manual, what temp do you set as the TRV may not have a schedule (unlikely but possible).

I wonder in this scenario we look at the scheduled set point (as you suggest) and if this doesn't exist then you set to CalculatedTemperature. Other option is to set it to Min Temp.

The wiser app doesn't really work like the HA climate control as the temp setting includes 'off', whereas in HA you can only set the temp down to 5C (or min config setting). As such you cannot take it from off to a temp setting in HA.

@asantaga
Copy link
Owner

Agree,..

The problem is manual doesnt really have any "default setting"... I think it might be a case of setting it to the min temp and letting the user then set it to what ever temp they are interested in ..

BTW What HA usecase are we trying to solve here?

@msp1974
Copy link
Collaborator Author

msp1974 commented Dec 17, 2019

The use case is that I have some rooms we do not use very often and therefore want to be able to stop heating them but keep a schedule so that when we do use them (guest visiting etc) that I can just enable this and the room is heated appropriately.

With this use case, and being able to turn the TRV off, the thermostat card in lovelace then does not function correctly when setting to manual. This is because the logic needed to be 'off' is set to manual and -20C. In order to have just manual, the only change is setting the temp to something above 5C. As such, when changing from off to manual it is really a question of what temp to set.

I think your earlier suggestion of setting to the scheduled temp, and if that doesn't exist or the schedule itself is set to 'off', set to min temp seems to be a logical solution.

However, where the logic for this sits is probably a question. Whether the api should control this logic or the HA component.

@asantaga
Copy link
Owner

asantaga commented Dec 17, 2019 via email

@msp1974
Copy link
Collaborator Author

msp1974 commented Dec 17, 2019

Look at ScheduledSetPoint on Room attributes to get current scheduled temp - no need to query whole schedule.

@asantaga
Copy link
Owner

Just implemented this in the latest commit. Give it ago and let me know

# Set room 4 TRVs to off, which is -200
wh.setRoomMode(4,"off")
# Set room 4 TRVs to manual, setting normal scheduled temp
wh.setRoomMode(4,"manual")

@msp1974
Copy link
Collaborator Author

msp1974 commented Dec 21, 2019

This is great thanks. One slight issue is that is the schedule is set to off is doesn't actually go into proper manual mode and technically stays off. Then in HA on the thermostat card you cannot adjust the temp. Think it still needs some check to set it to the min temp if below that.

@msp1974
Copy link
Collaborator Author

msp1974 commented Dec 22, 2019

Also found another slight issue. Your new temp range checks on setRoomTemperature are looking at the wrong range. The temp is passed in degrees C before it is converted to wiser range 50 to 300. As such it should be checking for temps between 5 and 30 or -20.

@asantaga
Copy link
Owner

hey yep, just fixed that.. No idea why I re-coded it to use 50-300..... The brain wasnt working..

Also if i had proper test suites :-) Should be fine now

@asantaga
Copy link
Owner

This is great thanks. One slight issue is that is the schedule is set to off is doesn't actually go into proper manual mode and technically stays off. Then in HA on the thermostat card you cannot adjust the temp. Think it still needs some check to set it to the min temp if below that.

mmm I need to see this in my HA

@msp1974
Copy link
Collaborator Author

msp1974 commented Dec 24, 2019

Angelo, now we can turn off in HA, if you set schedule to be off for a TRV and then turn off in HA and then to manual, you will see it stays off. It is this situation we need to set to min temp of 5C of manual mode so that if it is below. You will also see that the dial to change temp is missing the control to increase temp if below 5C. Also note, in your readme in HA config, you show -5C as min. This should be 5C.

asantaga pushed a commit that referenced this issue Jan 12, 2020
Fix for issue #1.  Only shows warning if room has no TRVs or RoomStats
@asantaga
Copy link
Owner

Mark confirming, this issue is now fixed with your PR?

@msp1974
Copy link
Collaborator Author

msp1974 commented Jan 12, 2020

Yes

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