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

external sensor reverts back after setting #31

Open
IsaacBreuer opened this issue May 28, 2021 · 7 comments
Open

external sensor reverts back after setting #31

IsaacBreuer opened this issue May 28, 2021 · 7 comments

Comments

@IsaacBreuer
Copy link

IsaacBreuer commented May 28, 2021

I followed the new instructions to use external temperature sensor, works great, but i believe it extremely important to add to instructions that if you are using a HA sensor and your HA is set to use Fahrenheit as mine is, you have to convert the ha value before passing it to HeatPump
as

 - lambda: 'id(hp).set_remote_temperature((x-32) * 5/9);'

instead of

      - lambda: 'id(hp).set_remote_temperature(x);'

however, even after conversation, I still ha r some issue, the current temperature reported, keeps switching back and forth from external to builtin, I suspect that the rounding may cuase it to get value that set it back, I am now sure though

@IsaacBreuer IsaacBreuer changed the title external sensor readme need update external sensor rounding issue May 28, 2021
@IsaacBreuer
Copy link
Author

IsaacBreuer commented May 28, 2021

see here my log from esphome that current temperature get randomly set to different what the set_remote_temperature did

['sensor.kitbt_temperature': Got state 66.70�
[D][sensor:099]: 'kitbt from homeassistant': 
Sending state 66.70000  with 1 decimals of accuracy�
[D][MitsubishiHeatPump:410]: Setting remote temp: 19.3�
[D][sensor:099]: 'kit ac Uptime': Sending state 6765.68115 s with 0 decimals of accuracy�
[D][sensor:099]: 'kit ac WiFi Signal': Sending state -60.00000 dBm with 0 decimals of accuracy�
[D][homeassistant.sensor:019]: 'sensor.kitbt_temperature': Got state 66.70�
[D][sensor:099]: 'kitbt from homeassistant': Sending state 66.70000  with 1 decimals of accuracy�
**[D][MitsubishiHeatPump:410]: Setting remote temp: 19.3�**
[D][sensor:099]: 'kit ac Uptime': Sending state 6825.68311 s with 0 decimals of accuracy�
[D][sensor:099]: 'kit ac WiFi Signal': Sending state -59.00000 dBm with 0 decimals of accuracy�
[D][homeassistant.sensor:019]: 'sensor.kitbt_temperature': Got state 66.90�
[D][sensor:099]: 'kitbt from homeassistant': Sending state 66.95000  with 1 decimals of accuracy�
**[D][MitsubishiHeatPump:410]: Setting remote temp: 19.4�**
[D][climate:262]: 'Kit AC' - Sending state:�
[D][climate:265]:   Mode: COOL�
[D][climate:267]:   Action: IDLE�
[D][climate:270]:   Fan Mode: HIGH�
[D][climate:273]:   Swing Mode: OFF�
**[D][climate:276]:   Current Temperature: 20.50°C�**
[D][climate:282]:   Target Temperature: 21.00°C�
[D][sensor:099]: 'kit ac Uptime': Sending state 6885.68311 s with 0 decimals of accuracy�
[D][climate:262]: 'Kit AC' - Sending state:�
[D][climate:265]:   Mode: COOL�
[D][climate:267]:   Action: COOLING�
[D][climate:270]:   Fan Mode: HIGH�
[D][climate:273]:   Swing Mode: OFF�
**[D][climate:276]:   Current Temperature: 20.50°C�**
[D][climate:282]:   Target Temperature: 21.00°C�
[D][climate:262]: 'Kit AC' - Sending state:�
[D][climate:265]:   Mode: COOL�
[D][climate:267]:   Action: COOLING�
[D][climate:270]:   Fan Mode: HIGH�
[D][climate:273]:   Swing Mode: OFF�
**[D][climate:276]:   Current Temperature: 19.50°C�**
[D][climate:282]:   Target Temperature: 21.00°C�
[D][climate:262]: 'Kit AC' - Sending state:�
[D][climate:265]:   Mode: COOL�
[D][climate:267]:   Action: IDLE�
[D][climate:270]:   Fan Mode: HIGH�
[D][climate:273]:   Swing Mode: OFF�
**[D][climate:276]:   Current Temperature: 19.50°C�**
[D][climate:282]:   Target Temperature: 21.00°C�
[D][sensor:099]: 'kit ac WiFi Signal': Sending state -60.00000 dBm with 0 decimals of accuracy�
[D][sensor:099]: 'kit ac Uptime': Sending state 6945.68701 s with 0 decimals of accuracy�
[D][sensor:099]: 'kit ac WiFi Signal': Sending state -59.00000 dBm with 0 decimals of accuracy�
[D][climate:262]: 'Kit AC' - Sending state:�
[D][climate:265]:   Mode: COOL�
[D][climate:267]:   Action: IDLE�
[D][climate:270]:   Fan Mode: HIGH�
[D][climate:273]:   Swing Mode: OFF�
**[D][climate:276]:   Current Temperature: 20.50°C�**
[D][climate:282]:   Target Temperature: 21.00°C�
[D][homeassistant.sensor:019]: 'sensor.kitbt_temperature': Got state 67.10�
[D][sensor:099]: 'kitbt from homeassistant': Sending state 67.10000  with 1 decimals of accuracy�
**[D][MitsubishiHeatPump:410]: Setting remote temp: 19.5�**
[D][sensor:099]: 'kit ac Uptime': Sending state 7005.68213 s with 0 decimals of accuracy�
[D][sensor:099]: 'kit ac WiFi Signal': Sending state -60.00000 dBm with 0 decimals of accuracy�
[D][climate:262]: 'Kit AC' - Sending state:�
[D][climate:265]:   Mode: COOL�
[D][climate:267]:   Action: IDLE�
[D][climate:270]:   Fan Mode: HIGH�
[D][climate:273]:   Swing Mode: OFF�
**[D][climate:276]:   Current Temperature: 19.50°C�**
[D][climate:282]:   Target Temperature: 21.00°C�
[D][sensor:099]: 'kit ac Uptime': Sending state 7065.68701 s with 0 decimals of accuracy�
[D][climate:262]: 'Kit AC' - Sending state:�
[D][climate:265]:   Mode: COOL�
[D][climate:267]:   Action: IDLE�
[D][climate:270]:   Fan Mode: HIGH�
[D][climate:273]:   Swing Mode: OFF�
**[D][climate:276]:   Current Temperature: 20.50°C�**
[D][climate:282]:   Target Temperature: 21.00°C�
[D][climate:262]: 'Kit AC' - Sending state:�
[D][climate:265]:   Mode: COOL�
[D][climate:267]:   Action: COOLING�
[D][climate:270]:   Fan Mode: HIGH�
[D][climate:273]:   Swing Mode: OFF�
[D][climate:276]:   Current Temperature: 20.50°C�
[D][climate:282]:   Target Temperature: 21.00°C�
[D][sensor:099]: 'kit ac WiFi Signal': Sending state -59.00000 dBm with 0 decimals of accuracy�
[D][homeassistant.sensor:019]: 'sensor.kitbt_temperature': Got state 67.10�
[D][sensor:099]: 'kitbt from homeassistant': Sending state 67.10000  with 1 decimals of accuracy�
[D][MitsubishiHeatPump:410]: Setting remote temp: 19.5�

@geoffdavis
Copy link
Owner

Try forcing the math to be floats all the way through the conversion process by using decimal numbers instead of integers:

- lambda: 'id(hp).set_remote_temperature((x-32.0) * 5.0/9.0);'

I have to admit I got lazy and just switched my US-based install to "degrees of Communism" instead of "degrees of Freedom" to avoid a bunch of the artifacting issues with temperature conversions. Wife acceptance factor was diminished, but she got used to it eventually.

@IsaacBreuer
Copy link
Author

IsaacBreuer commented May 28, 2021 via email

@IsaacBreuer
Copy link
Author

IsaacBreuer commented May 28, 2021 via email

@IsaacBreuer IsaacBreuer changed the title external sensor rounding issue external sensor reverts back after setting May 28, 2021
@sijk
Copy link

sijk commented May 28, 2021

This could possibly be something to do with your heat pump model. From upstream issues (e.g. SwiCago/HeatPump#69, SwiCago/HeatPump#144) it sounds like there are two methods used by different models to set the remote temperature, and who knows if that covers everything? Either way, the relevant code is at https://github.com/SwiCago/HeatPump/blob/master/src/HeatPump.cpp#L248 if that helps.

@IsaacBreuer
Copy link
Author

IsaacBreuer commented May 30, 2021 via email

@akifbayram
Copy link

akifbayram commented Aug 6, 2022

The function gets through successfully, but then after like 30 seconds reverts back , so I added a automation in HA to update a attribute for that particular sensor every 25 seconds, so far this work, but is just a workaround

Can you share the automation you used to update the sensor? My attempts aren't updating the whole sensor. I'm having the same issue with my MVZ air handler. Reverts to onboard temp sensor after ~3 minutes.

EDIT:
Added a heartbeat to the sensor in esphome. Seems to have solved my issue.

  - platform: homeassistant
    name: "Temperature Sensor From Home Assistant"
    entity_id: sensor.temperature_living_airgradient_forced
    on_value:
      then:
        - lambda: 'id(heatpump_main).set_remote_temperature((x-32.0) * 5.0/9.0);'
    filters:
      - heartbeat: 10s

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

4 participants