Ok Done. Changed back to capitals.
Put wait (1000);
Fresh mysensors.json
And… Same…
2017-07-28 11:39:55 DEBUG (Thread-6) [mysensors.gateway_mqtt] Receiving 31;255;0;0;17;2.1.1
2017-07-28 11:39:55 DEBUG (Thread-5) [mysensors.gateway_mqtt] Receiving 31;255;3;0;6;0
2017-07-28 11:39:55 DEBUG (Thread-13) [homeassistant.components.mysensors] Update: node 31, child 255 sub_type 17
2017-07-28 11:39:55 DEBUG (Thread-13) [homeassistant.components.mysensors] No sketch_name: node 31
2017-07-28 11:39:55 DEBUG (Thread-13) [homeassistant.components.mysensors] No sketch_name: node 31
2017-07-28 11:39:55 DEBUG (Thread-13) [homeassistant.components.mysensors] No sketch_name: node 31
2017-07-28 11:39:55 DEBUG (Thread-13) [homeassistant.components.mysensors] No sketch_name: node 31
2017-07-28 11:39:55 DEBUG (Thread-13) [homeassistant.components.mysensors] No sketch_name: node 31
2017-07-28 11:39:55 DEBUG (Thread-13) [homeassistant.components.mysensors] No sketch_name: node 31
2017-07-28 11:39:55 DEBUG (Thread-13) [homeassistant.components.mysensors] No sketch_name: node 31
2017-07-28 11:39:55 DEBUG (Thread-13) [mysensors.gateway_mqtt] Publishing 31;255;3;0;6;M
2017-07-28 11:39:56 DEBUG (Thread-10) [mysensors.gateway_mqtt] Receiving 31;255;3;0;11;Heatpump
2017-07-28 11:39:56 DEBUG (Thread-9) [mysensors.gateway_mqtt] Receiving 31;255;3;0;12;2.1
2017-07-28 11:39:56 DEBUG (Thread-13) [homeassistant.components.mysensors] Update: node 31, child 255 sub_type 11
2017-07-28 11:39:56 DEBUG (Thread-4) [mysensors.gateway_mqtt] Receiving 31;0;0;0;29;Thermostat
2017-07-28 11:39:56 DEBUG (Thread-13) [homeassistant.components.mysensors] Update: node 31, child 255 sub_type 12
2017-07-28 11:39:56 DEBUG (Thread-13) [homeassistant.components.mysensors] Update: node 31, child 0 sub_type 29
2017-07-28 11:39:56 DEBUG (Thread-13) [mysensors.gateway_mqtt] Subscribing to: mys-out/31/0/1/+/+
2017-07-28 11:39:56 DEBUG (Thread-13) [mysensors.gateway_mqtt] Subscribing to: mys-out/31/0/2/+/+
2017-07-28 11:39:56 DEBUG (Thread-13) [mysensors.gateway_mqtt] Subscribing to: mys-out/31/+/4/+/+
2017-07-28 11:39:57 DEBUG (Thread-6) [mysensors.gateway_mqtt] Receiving 31;0;1;0;22;1
2017-07-28 11:39:57 DEBUG (Thread-13) [homeassistant.components.mysensors] Update: node 31, child 0 sub_type 22
2017-07-28 11:39:58 DEBUG (Thread-5) [mysensors.gateway_mqtt] Receiving 31;0;1;0;21;1
2017-07-28 11:39:58 DEBUG (Thread-13) [homeassistant.components.mysensors] Update: node 31, child 0 sub_type 21
2017-07-28 11:39:58 INFO (Thread-13) [homeassistant.components.mysensors] Adding new devices: [<Entity Heatpump 31 0: unknown>]
2017-07-28 11:39:58 DEBUG (Thread-3) [homeassistant.components.climate.mysensors] Heatpump 31 0: value_type 21, value = 1
2017-07-28 11:39:58 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 11:40:00 DEBUG (Thread-10) [mysensors.gateway_mqtt] Receiving 31;0;2;0;44;
2017-07-28 11:40:02 DEBUG (Thread-7) [mysensors.gateway_mqtt] Receiving 31;0;2;0;22;
2017-07-28 11:40:02 DEBUG (Thread-13) [mysensors.gateway_mqtt] Publishing 31;0;1;0;22;1
2017-07-28 11:40:02 DEBUG (Thread-12) [mysensors.gateway_mqtt] Receiving 31;0;1;0;22;1
2017-07-28 11:40:02 DEBUG (Thread-13) [homeassistant.components.mysensors] Update: node 31, child 0 sub_type 22
2017-07-28 11:40:02 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 11:40:02 DEBUG (Thread-6) [mysensors.gateway_mqtt] Receiving 31;0;2;0;21;
2017-07-28 11:40:02 DEBUG (Thread-13) [mysensors.gateway_mqtt] Publishing 31;0;1;0;21;1
2017-07-28 11:40:02 DEBUG (Thread-3) [mysensors.gateway_mqtt] Receiving 31;0;1;0;21;1
2017-07-28 11:40:02 DEBUG (Thread-13) [homeassistant.components.mysensors] Update: node 31, child 0 sub_type 21
2017-07-28 11:40:02 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 11:40:02 DEBUG (Thread-1) [mysensors.gateway_mqtt] Receiving 31;0;1;0;44;20
2017-07-28 11:40:02 DEBUG (Thread-13) [homeassistant.components.mysensors] Update: node 31, child 0 sub_type 44
2017-07-28 11:40:02 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 11:40:03 DEBUG (Thread-10) [mysensors.gateway_mqtt] Receiving 31;0;1;0;22;1
2017-07-28 11:40:03 DEBUG (Thread-13) [homeassistant.components.mysensors] Update: node 31, child 0 sub_type 22
2017-07-28 11:40:03 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 11:40:04 DEBUG (Thread-4) [mysensors.gateway_mqtt] Receiving 31;0;1;0;21;1
2017-07-28 11:40:04 DEBUG (Thread-13) [homeassistant.components.mysensors] Update: node 31, child 0 sub_type 21
2017-07-28 11:40:04 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 11:40:06 DEBUG (Thread-6) [mysensors.gateway_mqtt] Receiving 31;0;2;0;44;
2017-07-28 11:40:06 DEBUG (Thread-13) [mysensors.gateway_mqtt] Publishing 31;0;1;0;44;20
2017-07-28 11:40:06 DEBUG (Thread-3) [mysensors.gateway_mqtt] Receiving 31;0;1;0;44;20
2017-07-28 11:40:06 DEBUG (Thread-13) [homeassistant.components.mysensors] Update: node 31, child 0 sub_type 44
2017-07-28 11:40:06 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 11:40:06 DEBUG (Thread-1) [mysensors.gateway_mqtt] Receiving 31;0;2;0;22;
2017-07-28 11:40:06 DEBUG (Thread-13) [mysensors.gateway_mqtt] Publishing 31;0;1;0;22;1
2017-07-28 11:40:06 DEBUG (Thread-9) [mysensors.gateway_mqtt] Receiving 31;0;1;0;22;1
2017-07-28 11:40:06 DEBUG (Thread-13) [homeassistant.components.mysensors] Update: node 31, child 0 sub_type 22
2017-07-28 11:40:06 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 11:40:06 DEBUG (Thread-7) [mysensors.gateway_mqtt] Receiving 31;0;2;0;21;
2017-07-28 11:40:06 DEBUG (Thread-13) [mysensors.gateway_mqtt] Publishing 31;0;1;0;21;1
This i what the code looks like
/*
* Documentation: http://www.mysensors.org
* Support Forum: http://forum.mysensors.org
*/
#define MY_RF24_CE_PIN 8
#define MY_RADIO_NRF24
#define MY_NODE_ID 31
#define CHILD_ID_HVAC 0
#include <MySensors.h>
// Change and uncomment only your heatpump model
#include <FujitsuHeatpumpIR.h>
//#include <PanasonicCKPHeatpumpIR.h>
//#include <PanasonicHeatpumpIR.h>
//#include <CarrierHeatpumpIR.h>
//#include <MideaHeatpumpIR.h>
//#include <MitsubishiHeatpumpIR.h>
//#include <SamsungHeatpumpIR.h>
//#include <SharpHeatpumpIR.h>
//#include <DaikinHeatpumpIR.h>
//Some global variables to hold the states
int POWER_STATE;
int TEMP_STATE = 20;
int FAN_STATE;
int MODE_STATE;
int VDIR_STATE;
int HDIR_STATE;
String HA_MODE_STATE = "Off";
String HA_FAN_STATE = "Auto";
IRSenderPWM irSender(3); // IR led on Arduino digital pin 3, using Arduino PWM
//Change to your Heatpump
HeatpumpIR *heatpumpIR = new FujitsuHeatpumpIR();
/*
new PanasonicDKEHeatpumpIR()
new PanasonicJKEHeatpumpIR()
new PanasonicNKEHeatpumpIR()
new CarrierHeatpumpIR()
new MideaHeatpumpIR()
new FujitsuHeatpumpIR()
new MitsubishiFDHeatpumpIR()
new MitsubishiFEHeatpumpIR()
new SamsungHeatpumpIR()
new SharpHeatpumpIR()
new DaikinHeatpumpIR()
*/
bool initialValueSent = false;
bool initialValueSentArray[] = {false, false, false};
MyMessage msgHVACSetPointC(CHILD_ID_HVAC, V_HVAC_SETPOINT_COOL);
MyMessage msgHVACSpeed(CHILD_ID_HVAC, V_HVAC_SPEED);
MyMessage msgHVACFlowState(CHILD_ID_HVAC, V_HVAC_FLOW_STATE);
void presentation() {
sendSketchInfo("Heatpump", "2.1");
present(CHILD_ID_HVAC, S_HVAC, "Thermostat");
}
void setup() {
}
void loop() {
// put your main code here, to run repeatedly:
if (!initialValueSent) {
Serial.println("Sending initial value");
sendNewStateToGateway();
wait (1000);
Serial.println("Requesting initial value from controller");
request(CHILD_ID_HVAC, V_HVAC_SETPOINT_COOL);
wait(2000, C_SET, V_HVAC_SETPOINT_COOL);
request(CHILD_ID_HVAC, V_HVAC_SPEED);
wait(2000, C_SET, V_HVAC_SPEED);
request(CHILD_ID_HVAC, V_HVAC_FLOW_STATE);
wait(2000, C_SET, V_HVAC_FLOW_STATE);
}
}
void receive(const MyMessage &message) {
if (message.isAck()) {
Serial.println("This is an ack from gateway");
return;
}
if (!initialValueSent) {
Serial.println("Receiving initial value from controller");
}
Serial.print("Incoming message for: ");
Serial.print(message.sensor);
String recvData = message.data;
recvData.trim();
Serial.print(", New status: ");
Serial.println(recvData);
switch (message.type) {
case V_HVAC_SPEED:
Serial.println("V_HVAC_SPEED");
if(recvData.equalsIgnoreCase("auto")) FAN_STATE = 0;
else if(recvData.equalsIgnoreCase("min")) FAN_STATE = 1;
else if(recvData.equalsIgnoreCase("normal")) FAN_STATE = 2;
else if(recvData.equalsIgnoreCase("max")) FAN_STATE = 3;
HA_FAN_STATE = recvData;
initialValueSentArray[1] = true;
sendFanStateToGateway();
break;
case V_HVAC_SETPOINT_COOL:
Serial.println("V_HVAC_SETPOINT_COOL");
TEMP_STATE = message.getFloat();
Serial.println(TEMP_STATE);
initialValueSentArray[0] = true;
sendTempStateToGateway();
break;
case V_HVAC_FLOW_STATE:
Serial.println("V_HVAC_FLOW_STATE");
if (recvData.equalsIgnoreCase("coolon")) {
POWER_STATE = 1;
MODE_STATE = MODE_COOL;
}
else if (recvData.equalsIgnoreCase("heaton")) {
POWER_STATE = 1;
MODE_STATE = MODE_HEAT;
}
else if (recvData.equalsIgnoreCase("autochangeover")) {
POWER_STATE = 1;
MODE_STATE = MODE_AUTO;
}
else if (recvData.equalsIgnoreCase("off")){
POWER_STATE = 0;
}
HA_MODE_STATE = recvData;
initialValueSentArray[2] = true;
sendModeStateToGateway();
break;
}
for (int i = 0; i < 3; i++) {
if (!initialValueSentArray[i]) {
initialValueSent = false;
break;
}
initialValueSent = true;
}
sendHeatpumpCommand();
}
void sendNewStateToGateway() {
send(msgHVACSetPointC.set(TEMP_STATE));
wait (1000);
send(msgHVACSpeed.set(HA_FAN_STATE));
wait (1000);
send(msgHVACFlowState.set(HA_MODE_STATE));
wait (1000);
}
void sendTempStateToGateway() {
send(msgHVACSetPointC.set(TEMP_STATE));
}
void sendFanStateToGateway() {
send(msgHVACSpeed.set(HA_FAN_STATE));
}
void sendModeStateToGateway() {
send(msgHVACFlowState.set(HA_MODE_STATE));
}
void sendHeatpumpCommand() {
Serial.println("Power = " + (String)POWER_STATE);
Serial.println("Mode = " + (String)MODE_STATE);
Serial.println("Fan = " + (String)FAN_STATE);
Serial.println("Temp = " + (String)TEMP_STATE);
heatpumpIR->send(
irSender, POWER_STATE, MODE_STATE, FAN_STATE, TEMP_STATE, VDIR_AUTO,
HDIR_AUTO);
}