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

Thermostat card does not reflect values sent by MQTT climate module #14961

Closed
3 tasks done
mbisak opened this issue Jan 2, 2023 · 11 comments
Closed
3 tasks done

Thermostat card does not reflect values sent by MQTT climate module #14961

mbisak opened this issue Jan 2, 2023 · 11 comments

Comments

@mbisak
Copy link

mbisak commented Jan 2, 2023

Checklist

  • I have updated to the latest available Home Assistant version.
  • I have cleared the cache of my browser.
  • I have tried a different browser to see if it is related to my browser.

Describe the issue you are experiencing

Thermostat card sometimes does not reflect target temperature value sent by the MQTT module. It reflects MQTT target temperature value in place where the ciphers are but does not reflect it in the point/ball position.

Point/ball usually stucks at position set by user even if it receives different value through MQTT. So for example user sets 21 degrees, it is displayed in the UI, MQTT publishes 21 degrees as confirmation but when MQTT publishes next value, for example 30 degrees, target temperature is changed but point/ball position stucks at 21.

For details, please check:
home-assistant/core#84745

Describe the behavior you expected

Ball/point position should always reflect values sent by MQTT

Steps to reproduce the issue

import paho.mqtt.client as mqttc

def on_message(client, userdata, msg):
print("Received",msg.topic+" "+str(msg.payload))
print("Publishing",MQTTSTATETOPIC,msg.payload)
mqttSession.publish(MQTTSTATETOPIC, msg.payload)
print("Publishing temp that HVAC set and decided internally", MQTTSTATETOPIC, 35)
mqttSession.publish(MQTTSTATETOPIC, 35)
print("------------")

MQTTBROKER = '192.168.2.10'
MQTTPORT = 1883
MQTTCMDTOPIC = 'etatherm/1/temperature/target/set'
MQTTSTATETOPIC = 'etatherm/1/temperature/target'
MQTTMODETOPIC = 'etatherm/1/mode'

print("Start")
mqttSession = mqttc.Client(client_id='test', protocol=mqttc.MQTTv311, transport='tcp')
mqttSession.connect(host=MQTTBROKER, port=MQTTPORT, keepalive=60)
mqttSession.subscribe(topic=MQTTCMDTOPIC)
mqttSession.on_message = on_message
mqttSession.publish(MQTTSTATETOPIC, 10)
mqttSession.publish(MQTTMODETOPIC, 'auto')

while True:
mqttSession.loop()


The MQTT object is defined like this:

name: "Pracovna"
object_id: etatherm_pracovna_topeni
unique_id: etatherm_pracovna_topeni
current_temperature_topic: "etatherm/1/temperature/real"
temperature_unit: "C"
precision: 1.0
min_temp: 6
max_temp: 35
initial: 19
temp_step: 1
temperature_state_topic: "etatherm/1/temperature/target"
mode_state_topic: "etatherm/1/mode"
mode_command_topic: "etatherm/1/mode/set"
temperature_command_topic: "etatherm/1/temperature/target/set"

climate.etatherm_pracovna_topeni:
hvac_modes:

auto
'off'
heat
friendly_name: Topení v pracovně

What version of Home Assistant Core has the issue?

2022.12.8

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

any

Which operating system are you using to run this browser?

Windows, Android

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

No response

@piitaya
Copy link
Member

piitaya commented Jan 6, 2023

Can you provide the state of your entity using dev tools? Thermostat card just reflect the temperature attribute from state.

@jbouwh
Copy link
Contributor

jbouwh commented Jan 9, 2023

I can confirm the state is updated, but MQTT updates the state to the original value of the climate UI element, not to the value set in the UI (since it is in pessimistic mode). That UI change is not directly followed by a state write. The state write happens later and reflects the device's actual state. This this the the same state as before the UI change. Somehow this state update is not recognized as a change because the entry state is not compared to the actual UI element state.

@mbisak
Copy link
Author

mbisak commented Jan 13, 2023

Can you provide the state of your entity using dev tools? Thermostat card just reflect the temperature attribute from state.

Hello, I'm not familiar with that so could you please provide me any link that would show me how?

Thank you, Martin

@msp1974
Copy link
Contributor

msp1974 commented Feb 17, 2023

@jbouwh I read this before logging and issue with this thermostat card and have now re-read and think this is the same issue I am having. Does the more-info dialog reflect the state correctly?

See issue #15483 - is this the same problem different symptom?

@mbisak
Copy link
Author

mbisak commented Feb 19, 2023

Hello,
more info dialog works strange as well. Requested auto target temp is 21. In auto mode, I set target temp by point to e.g. 35 degrees, point stucks at 35 even if MQTT publishes 35 and then 21. More info shows 21, but point is still stuck at 35. From this perspective more info works well. But if I change target temp using more info, I click on arrows and set 35, it should change back to 21 (MQTT sends 35 and 21). But it stucks at set target temp as well most of the time.

@karwosts
Copy link
Contributor

karwosts commented Feb 19, 2023

@mbisak - I think a screen recording may help show what you're seeing. I think I understand what you're saying but it's hard for me to imagine how that is happening, would be nice to visualize it. If you don't have one, I like https://www.screentogif.com/

I don't understand "MQTT publishes 35 and then 21". Why is it publishing 21 after 35, if you set it to 35? Does it all happen within a short period, or are you updating it back to 21 in the UI sometime later after updating to 35?

I'm not convinced your issue is the same as 15483... sounds a bit different to me, but maybe I'm just not understanding what you're saying.

@jbouwh
Copy link
Contributor

jbouwh commented Feb 20, 2023

@jbouwh I read this before logging and issue with this thermostat card and have now re-read and think this is the same issue I am having. Does the more-info dialog reflect the state correctly?

See issue #15483 - is this the same problem different symptom?

It looks like it.

@karwosts
Copy link
Contributor

karwosts commented Mar 9, 2023

Is this working now in 2023.3?

@jbouwh
Copy link
Contributor

jbouwh commented Jun 6, 2023

From what I can see, values set in the UI will be reset (after a short delay) to their initial state if the state is not confirmed. I think that is the expected behavior.

@jbouwh
Copy link
Contributor

jbouwh commented Jun 6, 2023

I believe this can be closed. Just tested this, and the behavior is correct now.

@jbouwh jbouwh closed this as completed Jun 6, 2023
@mbisak
Copy link
Author

mbisak commented Jun 6, 2023 via email

@github-actions github-actions bot locked and limited conversation to collaborators Jun 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants