A Forum run by Enthusiasts of MidNite Solar

MidNite Solar Monitoring software and hardware => My MidNite online monitoring => Topic started by: coniferous on February 11, 2020, 04:32:50 PM

Title: API for MyMidnite
Post by: coniferous on February 11, 2020, 04:32:50 PM
Hi all, I'm flexing my programming chops and trying to come up with a service to check the status of your batteries. The idea is you text a certain phone number and it'll respond with the current status of the batteries.

as it stands I've gotten automated text messaging working, and now I'm trying to get information off of the mymidnite site.

As far as I can tell there is a query that goes out to /?q=system/ajax with a bunch of input parameters, a from time (in unix time) and a to time. But to get to this page I need to establish a cookie to send with the session. ({"sys_id":"####","from":1580273999,"to":1581483599,"devices":{"##":{"type":"classic150","comm_revision":"2126"}}}

Is there any way to grab this data with something like an API key? or am I going to have to emulate the act of logging in?
Title: Re: API for MyMidnite
Post by: mcsarge on February 14, 2020, 12:05:28 AM
Why don't you do something with Graham's MQTT service? You could just connect to the MQTT and get any value you want?

Check out this post...

http://midniteftp.com/forum/index.php?topic=4817.0