Apoc182 / local_daikin

A home assistant integration for integrating Daikin air conditioners running firmware version 2.8.0 to Home Assistant.
24 stars 3 forks source link

Use external Temperature Sensor to unit. #2

Open epajfl00 opened 3 months ago

epajfl00 commented 3 months ago

An improvements to this AC unit; Is it possible to add the option to use other available Temperature sensor instead of the Daikin internal temp sensor? Currently, the Temp sensor in the wall unit is installed very high up, so the temperature sensed is not the room temp, but the ceiling temp. Hope you can consider this request, thanks.

Apoc182 commented 3 months ago

Can I clarify on this one:

You want to be able to specify a different entity to display the current temperature: specifically for use with the Lovelace UI element?

Sorry if a silly question, I have only just gotten an air conditioner for use with ha so have no idea what could be done with the previous integration.

epajfl00 commented 3 months ago

Yes, I'm suggesting have the option to be able to specify a different entity (an existing room Temperature entity) to display the current temperature and the AC use it as feedback to stop if temp reaches set temp. And yes it should be specifically used with the Lovelace UI element.

As I indicated, currently the Temp sensor in the AC wall unit is installed very high up, so the temperature sensed is not the actual room temp, instead it is much higher since it is the ceiling temp, as heat rises.

I see that in your code (line 19) there is a comment "# TODO make outside temp another sensor or something?" This is also a good idea, and what I'm suggesting is similar, but instead another inside sensor.

ajvandr commented 3 months ago

You could use an automation to achieve this by cycling the hvac between modes and fan speeds based on the temp of your external sensor or any other parameters that you might want included (time of day, occupancy etc).

Apoc182 commented 3 months ago

Yes, I'm suggesting have the option to be able to specify a different entity (an existing room Temperature entity) to display the current temperature and the AC use it as feedback to stop if temp reaches set temp. And yes it should be specifically used with the Lovelace UI element.

As I indicated, currently the Temp sensor in the AC wall unit is installed very high up, so the temperature sensed is not the actual room temp, instead it is much higher since it is the ceiling temp, as heat rises.

I see that in your code (line 19) there is a comment "# TODO make outside temp another sensor or something?" This is also a good idea, and what I'm suggesting is similar, but instead another inside sensor.

Thanks for the clarification.

I can certainly make it so you can pass in a custom sensor. The issue I have is that HA can't override the way the AC works to my knowledge. Your best bet would be as @ajvandr suggested.

If you know of another climate entity that can do this, let me know and I will see if i can work it out from the code.

Thanks.

epajfl00 commented 3 months ago

I understand if it can't be done, that is fine.

This may be impossible to replicate in your code, there is another solution for Daikin AC's where an ESP32 device is directly plugged in to the S21 connector, to fully control the unit with WiFi/HA. See this project: https://github.com/revk/ESP32-Faikin/blob/main/Manuals/Controls.md With this solution the following is mentioned: The Target uses the Daikin's own temperature sensor normally, but if you have a BlueCoinT BLE or Telink sensor you can select that as an external reference. This allows the room to be controlled based on a sensor that may be by your bed or where your sit.

I'm still hoping there is a way, it will the the solution so much better to use.

Apoc182 commented 3 months ago

This sounds like it would be useful. I could allow you to set the room temp that is displayed on the card fairly simply, but to have the unit use this value when deciding if it has arrived at max value or not would require some more investigation.

I hack that i can think of is:

If a custom entity is provided:

Internal unit temp reading (A): 25 External sensor reading (B): 18 Target temp from user (C): 25

In this example scenario, the unit will do nothing. But we know it is actually 18 degrees, so we need it to heat the room. So we can:

difference = A - B = 7 degrees Add the difference to the target from the user. target = target + difference = 32

Now the unit starts heating. Every time we update the state of the entity, we check the original target temp (25) against the sensor entity, which will eventually reach the desired target of 25. Once we arrive at the right temp, we take whatever reading we have from the internal sensor and set that to the target, effectively stopping the heating process. We can then keep checking we are where we need to be and repeat when things change.

Considerations

There is a lot to think about here. For one, it will only work for heating without considering the inverse, which i have not in my example. It also will need to carefully handle exceptional cases, of which i imagine there are a few.

Conclusion

I am pretty sure this is a bad implementation. It essentially tricks the unit into performing as if it were reading the external sensor, but it is really Home Assistant black magic that is doing the work. I would be interested to hear other takes on this approach or even suggest another one.

epajfl00 commented 3 months ago

Excellent, at least thinking of possibilities. Yes, hope that others developers can think of other options.

Just a thought would it help if the Temp sensor entity was added to the HA Config file (just like the ip addresses), so local_daikin could use it?