Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last data as JSON #30

Open
ldittmar81 opened this issue Aug 20, 2015 · 2 comments
Open

Last data as JSON #30

ldittmar81 opened this issue Aug 20, 2015 · 2 comments

Comments

@ldittmar81
Copy link

Hello,

first I want to thank for the great job here. :-)

I need a way to get the last datas as JSON for my home automation. I want to know, when my car needs fuel. Example: I go mornigs to work and I see that there is no enouth fuel in the tank, because my son was too lazy to refuel!!! :-( If my home automation system would know that my car has not enough gas in the tank , then they could tell me right after the wake , so I have enough time to refuel.

This wold be realy great :-)

@deennoo
Copy link

deennoo commented Nov 24, 2015

i try to do the same with domoticz, what's yours ?

@deennoo
Copy link

deennoo commented Dec 14, 2015

Please fond below a bash code to export last session fuel and km remaining to 2 virtual device on domoticz.

#!/bin/sh
result=mysql -u UTILISATEUR -pMOTDEPASSE torque -N -e "SELECT kff126b FROM raw_logs ORDER BY time DESC LIMIT 1"
echo $result
kmrestant=mysql -u UTILISATEUR -pMOTDEPASSE torque -N -e "SELECT kff126a FROM raw_logs ORDER BY time DESC LIMIT 1"
echo $kmrestant
curl -g "http://192.168.0.21:8080/json.htm?type=command&param=udevice&idx=376&nvalue=0&svalue=$result"
curl -g "http://192.168.0.21:8080/json.htm?type=command&param=udevice&idx=377&nvalue=0&svalue=$kmrestant"

Run it once a day and enjoy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants