API for MyMidnite

Started by coniferous, February 11, 2020, 04:32:50 PM

Previous topic - Next topic

coniferous

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?
Offgrid Trailer
1.4 Kw array, 1000AH of AGM batteries in 12v config
3000 watt main inverter, 300 aux inverter
1 Classic 150 - Plans to supplement with wind.

mcsarge

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
Off Grid Island in Ontario Canada (Beaverstone Bay)
Primary: Classic 150 + wbjr; 3s2p HES 270watt
Winter: SolarBoost 50 MPPT (into wbjr); 2 x Sharp NE-80EJEA 80watt
Pack: 4s2p ROLLS S6-460AGM 6V for 24V pack
Inverter/Charger: Trace DR2424
Call Sign: KG4EUF