Salve a tutti,
ho intenzione di controllare il condizionatore (ARGO CLIMA Slimmy) con Alexa.
Inizio dicendo che ho già creato altre interfacce con delle esp8266 e sinric, tramite le quali sono in grado di controllare varie cose (luci, led, tv...).
Mi è venuta l'idea di poter controllare anche il condizionatore, avendo però un telecomando volevo chiedervi se fosse possibile controllarlo usando un led ir e arduino (nel mio caso una esp8266).
Usando per la prima volta la libreria IRremote.h non sono mancati i primi problemi e dopo aver cercato in rete ho scoperto di dover usare una variante di questa libreria, ovvero la IRremoteESP8266.
Con mia grande sorpresa ho trovato negli esempi questo programma chiamato TurnOnArgoAC:
/* Copyright 2017, 2018 crankyoldgit
* An IR LED circuit *MUST* be connected to the ESP8266 on a pin
* as specified by kIrLed below.
*
* TL;DR: The IR LED needs to be driven by a transistor for a good result.
*
* Suggested circuit:
* https://github.com/crankyoldgit/IRremoteESP8266/wiki#ir-sending
*
* Common mistakes & tips:
* * Don't just connect the IR LED directly to the pin, it won't
* have enough current to drive the IR LED effectively.
* * Make sure you have the IR LED polarity correct.
* See: https://learn.sparkfun.com/tutorials/polarity/diode-and-led-polarity
* * Typical digital camera/phones can be used to see if the IR LED is flashed.
* Replace the IR LED with a normal LED if you don't have a digital camera
* when debugging.
* * Avoid using the following pins unless you really know what you are doing:
* * Pin 0/D3: Can interfere with the boot/program mode & support circuits.
* * Pin 1/TX/TXD0: Any serial transmissions from the ESP8266 will interfere.
* * Pin 3/RX/RXD0: Any serial transmissions to the ESP8266 will interfere.
* * ESP-01 modules are tricky. We suggest you use a module with more GPIOs
* for your first time. e.g. ESP-12 etc.
*/
#include <Arduino.h>
#include <IRremoteESP8266.h>
#include <IRsend.h>
#include <ir_Argo.h>
const uint16_t kIrLed = 4; // ESP8266 GPIO pin to use. Recommended: 4 (D2).
IRArgoAC ac(kIrLed); // Set the GPIO to be used to sending the message.
void setup() {
ac.begin();
Serial.begin(115200);
}
void loop() {
Serial.println("Sending...");
// Set up what we want to send. See ir_Argo.cpp for all the options.
ac.setPower(true);
ac.setFan(kArgoFan1);
ac.setMode(kArgoAuto);
ac.setTemp(25);
#if SEND_ARGO
// Now send the IR signal.
ac.send();
#else // SEND_ARGO
Serial.println("Can't send because SEND_ARGO has been disabled.");
#endif // SEND_ARGO
delay(5000);
}
Ho pensato di potermi salvare un po' di lavoro utilizzandolo ma non riesco ne ad accendere ne a spegnere il condizionatore.
C'è un modo di poter usare questo programma (con le sue funzioni) o devo per forza leggere il codice che trasmette il telecomando per ogni tasto premuto?
Ovviamente c'è anche l'opzione di smontare il telecomando e "moddarlo" per gestirlo con arduino...pero' vorrei evitarlo.
Grazie in anticipo.
P.S.: nella libreria c'è un file da cui si possono vedere le varie impostazioni (ir_Argo.cpp).
ir_Argo.cpp (12.4 KB)