Mysensors Thermostat
-
I'm making a thermostat with mysensors
define CHILD_ID_HEATER 0
MyMessage msgHeater(CHILD_ID_HEATER, V_HEATER_SW);
MyMessage msgTemp(CHILD_ID_HEATER, V_TEMP);
MyMessage msgUp(CHILD_ID_HEATER, V_UP);
MyMessage msgDown(CHILD_ID_HEATER, V_DOWN);void setup()
{
gw.begin(incomingMessage, NODE_ID, false); //nodo 6
gw.sendSketchInfo(SN, SV);
gw.present(CHILD_ID_HEATER, S_HEATER);
gw.send(msgTemp.set(tempVera));
.....V_HEATER_SW has the current temperature, turn off the power and heat button and two buttons + and - inside the threshold temperature
with gw.send(msgTemp.set(tempVera)); I send temperature to vera
with gw.send(msgHeater.set("Off"),true); and gw.send(msgHeater.set("HeatOn"),true); send to vera off ed heaton.My BIG problem:
how do I send through two buttons on Arduino + and - on Vera?if(digitalRead(BUTTON_PIN_MENO) == HIGH)
{
//send - to vera
}if(digitalRead(BUTTON_PIN_PIU) == HIGH)
{
//send + to vera
}
Thank Gigi
-
I'm making a thermostat with mysensors
define CHILD_ID_HEATER 0
MyMessage msgHeater(CHILD_ID_HEATER, V_HEATER_SW);
MyMessage msgTemp(CHILD_ID_HEATER, V_TEMP);
MyMessage msgUp(CHILD_ID_HEATER, V_UP);
MyMessage msgDown(CHILD_ID_HEATER, V_DOWN);void setup()
{
gw.begin(incomingMessage, NODE_ID, false); //nodo 6
gw.sendSketchInfo(SN, SV);
gw.present(CHILD_ID_HEATER, S_HEATER);
gw.send(msgTemp.set(tempVera));
.....V_HEATER_SW has the current temperature, turn off the power and heat button and two buttons + and - inside the threshold temperature
with gw.send(msgTemp.set(tempVera)); I send temperature to vera
with gw.send(msgHeater.set("Off"),true); and gw.send(msgHeater.set("HeatOn"),true); send to vera off ed heaton.My BIG problem:
how do I send through two buttons on Arduino + and - on Vera?if(digitalRead(BUTTON_PIN_MENO) == HIGH)
{
//send - to vera
}if(digitalRead(BUTTON_PIN_PIU) == HIGH)
{
//send + to vera
}
Thank Gigi