Closed kanawati975 closed 4 years ago
Sure, you can have as much SinricPro devices you like to have in just one sketch / one ESP module.
Include the libraries you need (SinricProLight.h
and SinricProTemperaturesensor.h
) and implement the callback functions to your need.
Edit: Example: I have a Switch device and a Temperature sensor device running in one sketch:
SinricProSwitch& myPC = SinricPro[PC_ID];
myPC.onPowerState(onTurnOnPC);
SinricProTemperaturesensor &myTemp = SinricPro[TEMP_ID];
myTemp.onPowerState(onTempPower);
@sivar2311 Vielen, lieben Dank. Thank you very much for your answer. I know for a fact that my lack of skills can be annoying, so please excuse my Ignorance. So, if I just compared a two examples and combined them and removed the repeated parts, I should have 2 functions in 1 sketch. Right?
So, if I just compared a two examples and combined them and removed the repeated parts, I should have 2 functions in 1 sketch. Right?
Yes, that's correct! See MultiSwitch_beginner Example.
In this example only Switch devices types have been used, but you could mix device types as you like to have it.
@sivar2311 Thank you once again. This is helpful. Would it be ok if I mixed two examples and let you take a look? If you have some free time, that would be highly appreciated.
Sure.
Please upload your code to gist github and share the link
@kanawati975 How did you proceed?
@sivar2311 Sorry I've got caught IRL and have a bad flu. I'll work on it as soon as possible
Oh, I'm sorry to hear that. Take your time. Get well soon!!
Closed due to inactivity. Please, feel free to reopen this issue if needed.
Hi again, This is an attempt... Hoping that I did ok:
https://gist.github.com/kanawati975/f5ae00fda05fa4f7d7a9273a64c2de26
Apart of a warning of depricated something in Websocketclient, the sketch was complied with no errors.
Hi everyone... Sorry to bother, but I'm very interested in your project and trying to learn as much as possible. My question: Would be hard to combine two sketches together? For instance: I'm using SinricPro on an ESP8266-12E and made a smart light in my room, and I'd love to also connect a sensor (such as DHT11) to the same board. Would that be possible? Thanks for your patience