From 1e526ab43b6d4f18f2b2c1e209a30897bb1acf8e Mon Sep 17 00:00:00 2001 From: mortenmathiasen Date: Sun, 15 Oct 2017 21:33:06 +0200 Subject: [PATCH] Make the example work as is (#3630) The HVAC component will not appear without valid initial values sent from the sketch. Initial default values added to avoid the problem. --- source/_components/climate.mysensors.markdown | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/_components/climate.mysensors.markdown b/source/_components/climate.mysensors.markdown index c629b0083fc..a61fae33f90 100644 --- a/source/_components/climate.mysensors.markdown +++ b/source/_components/climate.mysensors.markdown @@ -98,6 +98,8 @@ 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); +bool initialValueSent = false; + void presentation() { sendSketchInfo("Heatpump", "2.1"); present(CHILD_ID_HVAC, S_HVAC, "Thermostat"); @@ -108,6 +110,13 @@ void setup() { void loop() { // put your main code here, to run repeatedly: + if (!initialValueSent) { + send(msgHVACSetPointC.set(20)); + send(msgHVACSpeed.set("Auto")); + send(msgHVACFlowState.set("Off")); + + initialValueSent = true; + } } void receive(const MyMessage &message) {