Ejecute estos códigos para iniciar, iniciar y detener el monitoreo de su dispositivo ELIO IOT.
Abra ELIO Play y copie ‘mac’ y ‘key’ en el pie de página del panel de su dispositivo ELIO
PASO 1: Inicia tu ELIO
elio.init({ "mac": "80:65:99:DD:B0:1C", "key": "-NyPLcN9IqsvfZ7ZjCvv",});PASO 2: Comience a monitorear
elio.show({ container: ".values", id: ["time", "tempC", "humidity", "altitude", "proximity", "wirelessCharging", "pressure", "SSID", "tempOutC", "cubePosition", "noise", "vol", "IP", "DRAM", "PSRAM", "heap", "sunDetected", "batteryVoltage", "light", "IRlight"], play: 1, every: 5, class: "div inline-flex items-center content-center rounded-full px-[10px] m-[3px] h-[40px] bg-[white] text-[#E58139] border-[#E58139] border-solid border-[1px] select-none" });PASO 3: Deje de monitorear
elio.show({ container: ".values", play: 0,});elio.values({ success: function (response) {alert(JSON.stringify(response))}});elio.irCodes({ success: function (response) {alert(JSON.stringify(response))}});Cómo utilizar
<!-- Add this code in your html page header --><script src="https://elioiot.wp1.host/es/app/web/elioiot-api.js"></script><!-- Add this code in the body of the page --><script>// Open ELIO Play web app and copy 'mac' and 'key' on the footer of your ELIO device panelelio.init({mac: ..., key: ...}); // sets mac and key of the ELIO device one timeelio.values({success: ...}); //gets values from ELIO and calls the 'success' callback function</script>Lecciones
Lección 1: Acciones
elio.run({ "app": { "do": [{"timer": { "do": [ { "if": { "else": [ { "light": { "brightness": 100, "color": 12, "duration": 1, "led": 0 } } ], "is": [ "cubePosition", "==", 2 ], "then": [ { "light": { "brightness": 100, "color": 1, "duration": 1, "led": 0 } } ] } } ], "every": 1, "id": 0, "play": -1 }}]}});Lección 2: Evento
elio.run({ "app": { "do": [ { "on": { "do": [ { "light": { "brightness": 100, "color": 1, "duration": 1, "led": 0 } } ], "event": "cubicPositionChanged" } } ] }});Lección 3: Temporizador
elio.run({ "app": { "do": [ { "timer": { "after": 5, "do": [ { "light": { "color": 1, "duration": 1, "led": 0 } } ], "every": 2, "id": 0, "play": 3 } } ] }});Lección 4: Di
elio.run({ "app": { "do": [ { "say": { "text": "I'm going to read the minutes", "voice": "Salli" } }, { "timer": { "do": [ { "say": { "text": "It's", "voice": "Salli" } }, { "say": { "text": "minute", "voice": "Salli" } } ], "every": 5, "id": 0, "play": -1 } } ] }});Lección 5: Radio
elio.run({ "app": { "do": [ { "on": { "do": [ { "radio": { "play": 1, "url": "http://icestreaming.rai.it/1.mp3" } } ], "event": "touchSquare" } }, { "on": { "do": [ { "radio": { "play": 0 } } ], "event": "touchCircle" } } ] }});Lección 6: Si
elio.run({ "app": { "do": [ { "timer": { "do": [ { "if": { "else": [ { "light": { "brightness": 100, "color": 0, "duration": 1, "led": 0 } } ], "is": [ "cubePosition", "==", 2 ], "then": [ { "light": { "brightness": 100, "color": 1, "duration": 1, "led": 0 } } ] } } ], "every": 1, "id": 0, "play": -1 } } ] }});Lección 7: Si
elio.run({"app": { "do": [ { "set": [ "a", "=", 500 ] }, { "timer": { "do": [ { "set": [ "a", "+=", 10 ] }, { "buzzer": { "frequency": "a", "volume": 2 } } ], "every": 1, "id": 0, "play": 1 } } ]}});Lección 8: Webock
elio.run({"app": { "do": [ { "timer": { "do": [ { "webhook": { "url": "https://webhook.site/f0c1602e-2535-4367-9d8e-439520dbc8d6", "values": true } }, { "light": { "color": 1, "duration": 1, "led": 0 } } ], "every": 60, "id": 0, "play": -1 } } ]}});Lección 9: Webhoock
elio.run({"app": { "do": [ { "on": { "do": [ { "ir": { "command": "record", "key": 0, "recordTime": 5, "success": [ { "light": { "color": 5, "duration": 1, "led": 0 } } ] } }, { "light": { "color": 12, "duration": 5, "led": 0 } } ], "event": "touchCircle" } }, { "on": { "do": [ { "ir": { "command": "send", "key": 0 } }, { "light": { "color": 8, "duration": 1, "led": 0 } } ], "event": "touch1" } } ]}});Lección 10: Umbrales
elio.run({"app": { "do": [ { "thresholds": { "bright": 200, "dark": 50 } }, { "on": { "do": [ { "light": { "color": 0, "duration": 1, "led": 0 } } ], "event": "bright" } }, { "on": { "do": [ { "light": { "color": 1, "duration": 1, "led": 0 } } ], "event": "dark" } } ]}});Examples
Luz blanca durante 1 segundo
elio.run({ "app": { "do": [ { "light": { "led": 0, "color": 1, "duration": 1 } } ] }});Hacer un sonido
elio.run({ "app": { "do": [ { "buzzer": { "frequency": 440, "volume": 2 } } ] }});Sensor de oscuridad
elio.run({ "app": { "do": [ { "on": { "do": [ { "say": { "text": "it is dark", "voice": "Salli" } } ], "event": "dark" } } ]}});Di hola
elio.run({"app": { "do": [ { "say": { "text": "Hello", "voice": "Salli" } } ]}});Enciende la radio
elio.run({"app": { "do": [ { "say": { "text": "Power the radio", "voice": "Salli" } }, { "radio": { "play": 1, "url": "http://icestreaming.rai.it/1.mp3" } }, ]}});Temperatura que hace
elio.run({ "app": { "do": [ { "if": { "is": [ "tempC", ">=", 20 ], "then": [ { "say": { "text": "it's more than 20 degrees", "voice": "Salli" } } ] } } ] }});