-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Daikin] New datapoints for demand control #16479
Comments
See more details in #17036. In the future please post more info here to keep it all in one issue. Any further information would be helpful to whoever is going to implement this. Alternatively a PR from you would be welcomed too. |
This issue has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/daikin-brp069b4x-new-datapoints/154256/6 |
Please be aware that for disabling demand control it is enough to send In the Onecta binding |
This is going to create a lot of channels
Does this look like what you'd expect? I'm thinking that this should just be one channel containing a json data for all the schedule fields (mondayxxx - sundayxxx). so:
|
This issue has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/daikin-limiting-power-on-local-api/157181/2 |
To support the whole DemandControl feature, yes. |
EDIT: The channels are read-only at the moment. It doesn't yet allow sending a command to the aircon unit. @Jogobo Please test this jar file. It's a fake .txt file because github doesn't allow uploading a .jar file. Just rename and remove the extension. org.openhab.binding.daikin-4.3.0-SNAPSHOT.jar.txt You can see the channels in the MainUI, they are:
|
This version supports setting the demand control: |
Enabling demand control does not work. In general setting demand control is picky. For a fixed value setting must contain "?en_demand=1&mode=0&max_pow=" If you do not follow these rules the return value is always "PARAM NG" and demand control is not changed. Please keep in mind that "en_demand=0" resets "mode" to "0" and "max_pow" to "100". |
Yup, I found some bugs. Working on it.
Agreed.
Can you clarify this please? What do you mean "first" here? Do we need to send the schedule first, and send another set command to scheduled, or did you mean that the schedule has to be included in the one message (which is what I would think) |
I will I make it so:
|
"Scheduled" is quite complicated. To set a schedule you have to send a command with references to all days of the week. If there is no schedule for Tuesday you have to send "tuc=0". Now, when you change mode from "1" you have to read the current settings and store the schedule somewhere. Otherwise the schedule is lost. As I wrote before setting "en_demand=0" resets "mode" to "2" and "max_pow" to "100". In general "get_demand_control" returns the values sent with "en_demand=0" which makes it possible to restore the previous settings with "en_demand=1". |
@Jogobo thanks for the feedback and info. I'm going away tomorrow for a week (computer-free), but hoping that you could get a working version before then. Could you please test this one? org.openhab.binding.daikin-4.3.0-SNAPSHOT.jar.txt
|
OFF|MANUAL|SCHEDULED work, AUTO does not. Item linked to channel "Demand Control Max Power" shows "1 one" as value. Can be set by a slider on a sitemap but displays "1 one" again after setting. |
Thanks! Can you try changing your Item for maxpower to a plain Number item, no dimension (not even |
Plain Number works |
Please try this one... Hopefuly this fixes AUTO but please re-test manual and schedule |
Mode: Power: |
Thanks for testing. Let's hope this one works: org.openhab.binding.daikin-4.3.0-SNAPSHOT.jar.txt Power will have to be Dimmer now. I've removed the code that accepts Number (didn't work anyway). |
Mode settings work. Is it possible that In SCHEDULED mode "max_pow" reflects the power setting from the schedule and is read-only in this case? Otherwise the current demand control value is not visible to the user. |
How would you get the power setting from the schedule? Is it reported in the max_pow from get_demand_control request, or is it something that needs to be calculated based on the currentschedule ? If it's the latter, then I'd say no, not that it isn't possible, but I think this is something that needs to be calculated by user script. I understand that this is debatable and I'm not set on this yet, and I understand the convenience this would provide. However, doing so would mask/hide the current manual max_pow value. I'm not sure if the ac unit preserves this or not? If not, then maybe we can do as you suggested. If it's returned by get_demand_control, I guess you wouldn't have raised this issue because it would've done it already. Making the So other than the refinements being discussed here, does this now work correctly? |
This was slightly incorrect. To achieve this you have to send
|
This part is irrelevant to the binding, i.e. the binding merely passes through whatever schedule you gave it, straight to the ac unit, and interpreting it back. All it does is translate between the json syntax and the ac GET request parameters |
Should be important for documenting the JSON format for schedules. |
Thanks, yes that's an important thing to document. I presume the |
First test:
Second test:
Third test:
|
Thanks for doing the tests. Please try this version: |
First test:
Second test:
Third test:
If the scheduled power value no longer overwrites the stored manual power value I think that will be it. |
Sorry, but after waiting a couple of minutes with |
Please try this one. |
First test:Binding set Second test:Binding set It looks like changing a schedule from 3rd party overwrites the manual value in the binding. The rest seems to be perfect by now. |
|
I've put numbers in the above steps for easier reference. Did you let the binding poll the new status between step (1) and (2) above? The binding only saves the maxpower / schedule during its polling. So if you did step (2) before the binding had a chance to poll the new max_power, it wouldn't have saved it. Can you confirm this? I can make the binding save the maxpower / schedule immediately, in addition to during polling to close this gap. It was done this way several revisions ago :) |
Here's a version that immediately saves the maxpower / schedule when it's set through the binding, in addition to during polling: |
I just did the following test:
I think this is due to the fact that when you send a schedule with |
Did you wait until the binding polled for new info (1 minute after switching to manual in the last step)? |
Can the binding poll return a different value than what is returned by |
no, it can't. The poll result should give the same thing as
In your bulleted list above, you said "power item shows |
Sorry for this unclear documentation. So once again (and I hope I did not forget anything):
Conclusion:
|
what is the binding's
So far so good. This is fine, and shouldn't affect the binding's saved value.
This is also fine and the value of binding's
This would happen if at the very top above (before switching from manual to scheduled), the maxpower whilst in manual mode was 100.
This is fine. The binding does not save this value unless the polling says that it's currently in manual mode.
Yes.
Yup, this won't be saved when mode != 0.
Yes.
Yes.
Yes. At this point, I'm not exactly sure what the problem is. As I understand it:
Can you please try the following steps:
If the above steps failed, and max_pow somehow got set to 100, please turn on debugging
Then do the steps and paste the logs please. |
Sorry I've just had a look. You need to set the log level to |
I followed your steps and set Used the binding and changed
First of all, with the latest version the problem seems to be gone or my tasting was not as precise as it should have been. Great work! Just one little thing: when changing |
I had considered this exact situation. Whilst I can set I did make an exception with the maxpower under scheduled mode, because the unit doesn't report anything useful for that channel anyway. If it's important to you that the maxpower channel immediately updates after setting to manual mode, I can implement REFRESH handling for the maxpower channel, at which, it will do an immediate poll. This will require you to send a REFRESH command to (any) one of the channels. |
I suppose it's probably highly unlikely that the value set for maxpower is rejected by the device. I can update the channel immediately, knowing that on the next poll, it will get the actual value from the device anyway. Would you prefer this instead of waiting for the next poll? |
When you want to change |
If any of the 3 mandatory values |
This is how it works for all the channels on the binding. For example, AC is off, binding power is off. You send an ON command to the power channel, it would send the API request to turn on the AC, but the binding's power channel will still say off, until the next poll. This is why I don't want to deviate from this behaviour. You need to poll to get the actual status from the device, and not make assumptions. |
I do not agree with that. I know that the general behaviour of bindings is It is kind of philosophical whether the result code Changing In my opinion when the result is Polling, in this case, is only necessary to reflect changes not coming from the binding itself. Worst case is it takes "poll interval" until the changes made elsewhere arrive at the binding. But this is by design and mostly well documented. |
I agree with this in theory, although I have no way to confirm this. Can you try sending a set_demand_control with some invalid values, e.g.
I believe this is incorrect. You may be observing this behaviour because your Item is set to autoupdate. Try setting |
Correct. Forgot about autoupdate as it is enabled by default. This would lead to a more complex programming depending on the item's autoupdate setting. If
|
The thing is, to be consistent, we'd have to do this "proactive update" for all the channels. The way to do it is this: Whilst I'm not against this, I believe that is a big enough change that warrants its own separate PR. I do think it would make for a nicer and more responsive experience for the binding users, without compromising in "information integrity". I will finalise and submit this PR as is for now, without this automatic channel update. |
Fair enough. Thank you for your patience and time. There was a lot more to do than only adding some more channels. |
Thanks for doing all the tests! :) |
New datapoints have been discovered. Is it possible to add them to the binding?
Demand Control (manual)
http://DAIKIN-IP/aircon/set_demand_control?lpw=&en_demand=1&mode=0&type=1&max_pow=[40-100]
Demand Control (automatic)
http://DAIKIN-IP/aircon/set_demand_control?lpw=&en_demand=1&mode=2&type=1&max_pow=[40-100]
Demand Control (OFF):
http://daikin-ip/aircon/set_demand_control?lpw=&en_demand=0
Demand Control (State):
http://daikin-ip/aircon/get_demand_control?lpw=
More detailed information can be found here 1
The text was updated successfully, but these errors were encountered: