@skywatch said in Adding sensor to controller when it's part of gateway:
@Homer I am no expert in this but I have thought of something that you could try.
If I understand correctly you have added one RF433 transmitter to the GW node? This then sends data (On/Off) to the 6 RF433 sockets.
If so then the gateway only has one child, the RF433 transmitter, the sockets are not 'attached' to the GW.
So instead of presenting all 6 sockets, just present the one RF433 transmitter and see if that helps? All the code for the actions is in the receive section anyway.
This is how I did it with IR blaster and it works fine, changing IR for RF should not make a difference in the structure.
Hold on - I think I got it.....!!!!
You are using S_LIGHT in presentation - that is no longer supported.
Change S_LIGHT to S_BINARY.
Another thing is that although you are presenting your child(s), you do not define the type. I would expect a MyMessage in there somewhere at the start.
So add MyMessage msgyourmessage (child_id, V_STATUS);
And finally change V_LIGHT to V_STATUS in the receive function.
Thanks! Yes, you got it lol!!
The thing that is weird is that all I did was add the rf433 controlled devices from a working sketch to the gateway sketch, so why does it work when it's separate but not when it's part of the gateway sketch? If S_LIGHT is no longer supported, why does it work on a standalone sensor?