@tjay4x4 I completely understand.
Until about 3-4 weeks ago I did not even know what an Arduino was.
Yet, here I am creating a plugin for Indigo (I did not know about Indigo until about 8 weeks ago) and creating/testing very basic sensors.
Today I started creating my first 'home-grown' sensor and guess what: You have to try it to understand it
I know from experience that you can ask just about anything when you get stuck...
@qobouky You are correct, the Binary type sensors should be visible here.
I just revisited your sketch and I found a conflict on the allocated sensors id
#define CHILD_ID_HUM 0
#define CHILD_ID_TEMP 1
#define CHILD_ID_CO2 2
#define NUMBER_OF_RELAYS 3 // Total number of attached relays
void presentation() {
present(CHILD_ID_HUM, S_HUM);
present(CHILD_ID_TEMP, S_TEMP);
present(CHILD_ID_CO2, S_AIR_QUALITY);
for (int sensor=1, pin=RELAY_PIN; sensor<=NUMBER_OF_RELAYS; sensor++, pin++) {
// Register all sensors to gw (they will be created as child devices)
present(sensor, S_BINARY);
}
}
your relay sensor id should start from 3 or above.
I do not see the use of pin=RELAY_PIN.
You can present the status of your relay's, that can create V_STATUS on MyController
example:
#define RELAY_SENSOR 3 // Relay sensor starts at 3
void presentation() {
....
MyMessage relayMsg(RELAY_SENSOR, V_STATUS);
for (int sensor=RELAY_SENSOR; sensor < (RELAY_SENSOR + NUMBER_OF_RELAYS); sensor++) {
// Register all sensors to gw (they will be created as child devices)
present(sensor, S_BINARY);
relayMsg.sensor = sensor;
send(relayMsg.set(loadState(sensor))); // current status of the relay
}
}
NOTE: You have to update your relay code on setup and in receive too