Core: MySensors HVAC UI won't change - error KeyError: '1'

Created on 24 Apr 2017  路  8Comments  路  Source: home-assistant/core

Home Assistant release (hass --version):
0.43.0

Python release (python3 --version):
3.5.2

Component/platform:
MySensors (HVAC)

Description of problem:

When i change the "operation" or "fan mode" on a mysensors HVAC climate, it immediately changes back to the previous settings. Changes to "target temperature" work fine.

i.e.
If i change operation from "heat" to "cool", the ui on home assistant immediately flips back to "heat"
If i change operation from "heat" to "off", the ui on home assistant immediately flips back to "heat"
If i change fanmode to "min", the ui on home assistant immediately flips back to blank

The RF message to the mysensors node is sent successfully and correctly (and understood and acted on) but the web UI widget in homeassistant is now incorrect.

image

Expected:

I expected changing the "operation" or "fan mode" to not flip back to the previous setting every time i try to change it.

Problem-relevant configuration.yaml entries and steps to reproduce:

  1. Arduino sketch here https://gist.github.com/Br3nda/3f24ad0346c7d8f0ebfdbbdf55d72f31
mysensors:
  gateways:
    - device: '/dev/ttyUSB0'
      persistence_file: '/home/brenda/.homeassistant/mysensors.json'
      baud_rate: 115200
  optimistic: false
  persistence: true
  retain: true
  version: 2.0

Message arriving at node over RF:
image

Traceback (if applicable):
This error is logged by home assistant every time too:

17-04-24 10:32:29 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.heatpump_244_10 fails
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/helpers/entity.py", line 225, in async_update_ha_state
    None, self.update)
  File "/usr/lib/python3.5/asyncio/futures.py", line 361, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 296, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/components/climate/mysensors.py", line 170, in update
    self._values[value_type] = DICT_MYS_TO_HA[value]
KeyError: '1'

Additional info:

I have tried with and without sending a reply message like this

send(msgHVACSpeed.set(recvData));
waiting-for-reply

Most helpful comment

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment :+1:

All 8 comments

I set optimistic to true and it seems to work.

When having optimistic set to false, you should feedback state changes to home assistant from the receive method in your sketch. This goes for all mysensors actuators in home assistant.

The state will not change in home assistant until feedback is received, when optimistic is false.

The KeyErrror happens cause you have an unsupported value for V_HVAC_FLOW_STATE. It should be one of Off, CoolOn, HeatOn or AutoChangeOver.
https://www.mysensors.org/download/serial_api_20

Thanks for this! Can you elaborate on this:
"feedback state changes to home assistant from the receive method in your sketch"

I do send(msgHVACSpeed.set(recvData));
is this not what you mean?

Basically yes. I can't say if that line is correct without seeing the greater context.

Home assistant sends a state change eg off -> on to your mysensors device. The device handles that message in the receive method. The device should then after changing the state of the pin, or however the actuator is controlled, send the new state (on) back to home assistant, using the send method, as in your example.

Thanks again. I am sending that same state change back (after actuating it).
I'll do some more debug on if the state change gets back to the gateway.

Ok if i add this info here to the docs too?

Yes, please add it to the docs! I guess it should go on the main mysensors component page, close to where the config section is explained, and perhaps also on all the actuator pages?

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment :+1:

Resolved. Docs updated.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

WilldabeastHA picture WilldabeastHA  路  203Comments

nodkan picture nodkan  路  161Comments

gieljnssns picture gieljnssns  路  277Comments

raccettura picture raccettura  路  142Comments

balloob picture balloob  路  371Comments