Ok. Made the folloing adjustments to the sketch. Changed to wait (200) instead of delay.
Changed declarations
String HA_MODE_STATE = “Off”;
String HA_FAN_STATE = “Auto”;
From capitalized as it is down in the script so it became
String HA_MODE_STATE = “off”;
String HA_FAN_STATE = “auto”;
This is MQTT ouput from start up of sensor
mys-out/31/255/0/0/17 2.1.1
mys-out/31/255/3/0/6 0
mys-in/31/255/3/0/6 M
mys-out/31/255/3/0/11 Heatpump
mys-out/31/255/3/0/12 2.1
mys-out/31/0/0/0/29 Thermostat
mys-out/31/0/1/0/44 20
mys-out/31/0/1/0/22 1
mys-out/31/0/1/0/21 1
mys-out/31/0/2/0/44 (null)
mys-out/31/0/2/0/22 (null)
mys-in/31/0/1/0/22 1
mys-out/31/0/1/0/22 1
mys-out/31/0/2/0/21 (null)
mys-in/31/0/1/0/21 1
mys-out/31/0/1/0/21 1
mys-out/31/0/1/0/44 20
mys-out/31/0/1/0/22 1
mys-out/31/0/1/0/21 1
mys-out/31/0/2/0/44 (null)
mys-in/31/0/1/0/44 20
mys-out/31/0/1/0/44 20
mys-out/31/0/2/0/22 (null)
mys-in/31/0/1/0/22 1
mys-out/31/0/1/0/22 1
mys-out/31/0/2/0/21 (null)
mys-in/31/0/1/0/21 1
Than in the newly created mysensors.json i got this
{"31": {"_battery_level": 0, "protocol_version": "2.1.1", "children": {"0": {"id": 0, "type": 29, "values": {"44": "20", "21": "1", "22": "1"}, "description": "Thermostat"}}, "sensor_id": 31, "sketch_name": "Heatpump", "type": 17, "sketch_version": "2.1"}}
And in the HA logs
2017-07-28 10:32:45 DEBUG (Thread-13) [homeassistant.components.mysensors] Update: node 31, child 255 sub_type 17
2017-07-28 10:32:45 DEBUG (Thread-13) [homeassistant.components.mysensors] No sketch_name: node 31
2017-07-28 10:32:45 DEBUG (Thread-13) [homeassistant.components.mysensors] No sketch_name: node 31
2017-07-28 10:32:45 DEBUG (Thread-13) [homeassistant.components.mysensors] No sketch_name: node 31
2017-07-28 10:32:45 DEBUG (Thread-13) [homeassistant.components.mysensors] No sketch_name: node 31
2017-07-28 10:32:45 DEBUG (Thread-13) [homeassistant.components.mysensors] No sketch_name: node 31
2017-07-28 10:32:45 DEBUG (Thread-13) [homeassistant.components.mysensors] No sketch_name: node 31
2017-07-28 10:32:45 DEBUG (Thread-13) [homeassistant.components.mysensors] No sketch_name: node 31
2017-07-28 10:32:45 DEBUG (Thread-13) [homeassistant.components.mysensors] Update: node 31, child 255 sub_type 11
2017-07-28 10:32:45 DEBUG (Thread-13) [homeassistant.components.mysensors] Update: node 31, child 255 sub_type 12
2017-07-28 10:32:45 DEBUG (Thread-13) [homeassistant.components.mysensors] Update: node 31, child 0 sub_type 29
2017-07-28 10:32:45 DEBUG (Thread-13) [homeassistant.components.mysensors] Update: node 31, child 0 sub_type 22
2017-07-28 10:32:45 DEBUG (Thread-13) [homeassistant.components.mysensors] Update: node 31, child 0 sub_type 21
2017-07-28 10:32:45 INFO (Thread-13) [homeassistant.components.mysensors] Adding new devices: [<Entity Heatpump 31 0: unknown>]
2017-07-28 10:32:45 DEBUG (Thread-3) [homeassistant.components.climate.mysensors] Heatpump 31 0: value_type 21, value = 1
2017-07-28 10:32:45 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.4/asyncio/tasks.py", line 233, in _step
result = coro.throw(exc)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 381, in async_process_entity
new_entity, self, update_before_add=update_before_add
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 212, in async_add_entity
yield from self.hass.async_add_job(entity.update)
File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
value = future.result()
File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
raise self._exception
File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/climate/mysensors.py", line 183, in update
self._values[value_type] = DICT_MYS_TO_HA[value]
KeyError: '1'
2017-07-28 10:32:47 DEBUG (Thread-13) [homeassistant.components.mysensors] Update: node 31, child 0 sub_type 22
2017-07-28 10:32:47 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.4/asyncio/tasks.py", line 237, in _step
result = next(coro)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity.py", line 205, in async_update_ha_state
"No entity id specified for entity {}".format(self.name))
homeassistant.exceptions.NoEntitySpecifiedError: No entity id specified for entity Heatpump 31 0
2017-07-28 10:32:48 DEBUG (Thread-13) [homeassistant.components.mysensors] Update: node 31, child 0 sub_type 21
2017-07-28 10:32:48 DEBUG (Thread-13) [homeassistant.components.mysensors] Update: node 31, child 0 sub_type 44
2017-07-28 10:32:48 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.4/asyncio/tasks.py", line 237, in _step
result = next(coro)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity.py", line 205, in async_update_ha_state
"No entity id specified for entity {}".format(self.name))
homeassistant.exceptions.NoEntitySpecifiedError: No entity id specified for entity Heatpump 31 0
2017-07-28 10:32:48 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.4/asyncio/tasks.py", line 237, in _step
result = next(coro)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity.py", line 205, in async_update_ha_state
"No entity id specified for entity {}".format(self.name))
homeassistant.exceptions.NoEntitySpecifiedError: No entity id specified for entity Heatpump 31 0
2017-07-28 10:32:48 DEBUG (Thread-13) [homeassistant.components.mysensors] Update: node 31, child 0 sub_type 22
2017-07-28 10:32:48 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.4/asyncio/tasks.py", line 237, in _step
result = next(coro)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity.py", line 205, in async_update_ha_state
"No entity id specified for entity {}".format(self.name))
homeassistant.exceptions.NoEntitySpecifiedError: No entity id specified for entity Heatpump 31 0
2017-07-28 10:32:48 DEBUG (Thread-13) [homeassistant.components.mysensors] Update: node 31, child 0 sub_type 21
2017-07-28 10:32:48 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.4/asyncio/tasks.py", line 237, in _step
result = next(coro)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity.py", line 205, in async_update_ha_state
"No entity id specified for entity {}".format(self.name))
homeassistant.exceptions.NoEntitySpecifiedError: No entity id specified for entity Heatpump 31 0
2017-07-28 10:32:48 DEBUG (Thread-13) [homeassistant.components.mysensors] Update: node 31, child 0 sub_type 44
2017-07-28 10:32:48 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.4/asyncio/tasks.py", line 237, in _step
result = next(coro)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity.py", line 205, in async_update_ha_state
"No entity id specified for entity {}".format(self.name))
homeassistant.exceptions.NoEntitySpecifiedError: No entity id specified for entity Heatpump 31 0
2017-07-28 10:32:48 DEBUG (Thread-13) [homeassistant.components.mysensors] Update: node 31, child 0 sub_type 22
2017-07-28 10:32:48 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.4/asyncio/tasks.py", line 237, in _step
result = next(coro)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity.py", line 205, in async_update_ha_state
"No entity id specified for entity {}".format(self.name))
homeassistant.exceptions.NoEntitySpecifiedError: No entity id specified for entity Heatpump 31 0
No climate component showed up. So shall i change string to char array? Will look it up on the internet