IRSensor
-
Hi All,
I may have misunderstood the use case here.
Following the build http://www.mysensors.org/build/irI have connected only an IR Receive Sensor to Power 5V Grnd & Pin 8.
IR Transmitter is not connectedWhat I am trying to achieve is to press a button on a remote and then have domoticz act upon it through a script.
The Sensor serial monitor appears to be telling me that it is communicating with the Gateway, at least I don't see "Fail" anywhere. I can also see reference to IRSensor in the Domoticz log. So far so good.
A couple of questions
However I don't appear to see any device in the Domoticz list that I can add. Have I missed a step?I can see that some of the code has been commented out. Do I need to uncomment some of this (or all of it) in order for it to decode the IR button. I notice that some of it has // and some of it has /.../ Not really sure if I am supposed to uncomment all of it or just some.
Any help is greatly appreciated.
Best Wishes.
James.
-
Is the ir node not showing up in the mysensor gateway under the hardware settings tab?
-
Yes - The gateway is shown under Hardware. I am using it with other nodes Temp sensors.
I can also see the IR sensor in the Domoticz log
2016-02-05 07:51:23.671 MySensors: Node: 14, Sketch Name: IR Sensor 2016-02-05 07:51:23.702 MySensors: Node: 14, Sketch Version: 1.0I just can't find a device I can add.
Best wishes.
James.
-
Devices in Domoticz is not added until a correct first value is sent, its not enough with a presentation - is this the case?
-
Devices in Domoticz is not added until a correct first value is sent, its not enough with a presentation - is this the case?
@sundberg84
Thank you. I thought that might be the case. Hence my second original questionI can see that some of the code has been commented out. Do I need to uncomment some of this (or all of it) in order for it to decode the IR button. I notice that some of it has // and some of it has /.../ Not really sure if I am supposed to uncomment all of it or just some.
// Dumps out the decode_results structure. // Call this after IRrecv::decode() // void * to work around compiler issue //void dump(void *v) { // decode_results *results = (decode_results *)v /*void dump(decode_results *results) { int count = results->rawlen; if (results->decode_type == UNKNOWN) { Serial.print("Unknown encoding: "); } else if (results->decode_type == NEC) { Serial.print("Decoded NEC: "); } else if (results->decode_type == SONY) { Serial.print("Decoded SONY: "); } else if (results->decode_type == RC5) { Serial.print("Decoded RC5: "); } else if (results->decode_type == RC6) { Serial.print("Decoded RC6: "); } else if (results->decode_type == PANASONIC) { Serial.print("Decoded PANASONIC - Address: "); Serial.print(results->panasonicAddress,HEX); Serial.print(" Value: "); } else if (results->decode_type == JVC) { Serial.print("Decoded JVC: "); } Serial.print(results->value, HEX); Serial.print(" ("); Serial.print(results->bits, DEC); Serial.println(" bits)"); Serial.print("Raw ("); Serial.print(count, DEC); Serial.print("): "); for (int i = 0; i < count; i++) { if ((i % 2) == 1) { Serial.print(results->rawbuf[i]*USECPERTICK, DEC); } else { Serial.print(-(int)results->rawbuf[i]*USECPERTICK, DEC); } Serial.print(" "); } Serial.println(""); } */Can you advise what I should uncomment?
I presume once I have got the correct code from the serial monitor and running above. I can then enter it herevoid incomingMessage(const MyMessage &message) { // We only expect one type of message from controller. But we better check anyway. if (message.type==V_LIGHT) { int incomingRelayStatus = message.getInt(); if (incomingRelayStatus == 1) { irsend.send(NEC, 0x1EE17887, 32); // Vol up yamaha ysp-900 } else { irsend.send(NEC, 0x1EE1F807, 32); // Vol down yamaha ysp-900 } // Start receiving ir again... irrecv.enableIRIn(); } }This will then allow Domoticz to create the device switch.
Thank you for any help you can give.
Best wishes.
James
-
I thought I would close this. Just as well that my Google skills are better than my programming skills.
This sketch helped me out and resolved my issues.
https://www.domoticz.com/forum/viewtopic.php?f=42&t=7648&start=20#p53663
by gizmocuz. Thank you.Best wishes.
James.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login