Help on getting a python script translated to Spark Core

Hi all,

I’m currently building a home temperature logging system using a spark core. Coincidentally I came across the following post in which someone made it possible to read the temperature of a Evohome thermostat using a python script. Link

It would be great if I could use my spark core to pull temperature in several rooms through my evohome system, in order to log it and later act on it. However, I’m not familiar with the python language. Before I dive into learning a new programming language, I was hoping that someone could give me some advise on: if this is possible and if so, where I would start.

Regards
Rutger

I see that the website in the python script is https:// and the core would not be able read the data coming back.

Is that correct @bko?

Hey @Wildfire,

The SparkCore makes a great little sensor (like a weather station) and a great little actuator (blinds controller, pool controller, garage controller, etc) but it’s not the best suited to talk directly to apis and save a bunch of data. Will it do it? Sure (though as @kennethlimcp questioned, I don’t think it can handle SSL) but there are other services much better suited to do what I think you want to do . If you API is internet accessible I would suggest throwing up a small instance (perhaps in the Amazon cloud) and using that to call the API and log temps. If you api isn’t then I would suggest purchasing something like a Raspberry Pi (or similar) to do the logging.

Again, I’m not suggesting that the SparkCore is useless for your project. Not at all. I am just suggesting that perhaps you use a different mechanism to do you API calls and collect you data and instead use the SparkCore to act on said collected data. Example: your cloud instance (or Pi) detects that a room in your house is too warm but the AC is already on. It sends a signal, via the Spark Cloud, to your SparkCore in that room to open the air vent while telling all other cores to close their vents slightly. That would be a great use of the core!

That’s right. Unless there is a plain HTTP version of the site, it will be hard to get it to work directly.

There is a beta of a webhooks feature where the cloud does HTTPS actions for your core that would likely work.

You can also set up your own host pc or Raspberry Pi to act as your HTTPS agent.

In these cases your core talks to the intermediate agent which in turn talks to your web service that requires HTTPS.

Thanks guys for clarifying that. Perhaps I see the spark core a bit too much as a supercomputer.