#!/bin/bash
curl https://login.ohmconnect.com/verify-ohm-hour/[HERE_UNIQUE_ID_FROM_OHMCONNECT_SETTINGS] 2>/dev/null | xmllint --xpath '//ohmhour/active/text()' - | grep True > /dev/null
if [ $? == 0 ];
then
echo "$(DATE) ohmhour active" >> /var/log/ohmhour.log
wget http://[IP_ADDRESS_OR_NAME_OF_HUZZAH_ON_LAN]/r\?rapi=\$FD -O /dev/null
exit 1
else
#no Ohmhour
wget http://[IP_ADDRESS_OR_NAME_OF_HUZZAH_ON_LAN]/r\?rapi=\$FE -O /dev/null
fi
Try $FS to sleep the EVSE. It will start charging if you are in the window of the delay timer.
Danny, quit using $FD. I feel really bad for suggesting it.
I need to completely rethink what I was considering for your application. Thanks for explaining what you are trying to do with Ohmhour. I need to give a lot of thought to how best to handle what you are trying to do.Again, sorry I ever lead you to begin using the $FD command. I should have done my homework first.-Craig K.
--
You received this message because you are subscribed to the Google Groups "OpenEVSE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openevse+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
try sending sleep instead of enable? sorry, I'm out now and can't check the code
--
I forgot to add… a delay is needed between the $FS and $FD to allow the EVSE to open its contactor… so..
ohmhour start: $FS, wait 1 sec, $FD
ohmhour end: $FS
or even better,
ohmhour start: disable timer with $ST 0 0 0 0*0B, then sleep $FS
ohmhour end: renable timer with $ST.
I guess the missing piece to this, method, however, is that there’s currently no RAPI command to query the current timer setting, which you need to restore the previous one, but it will work OK if you have a fixed timer setting that you always use.
ohmhour start: disable timer with $ST 0 0 0 0*0B, then sleep $FS
ohmhour end: renable timer with $ST.
I guess the missing piece to this, method, however, is that there’s currently no RAPI command to query the current timer setting, which you need to restore the previous one, but it will work OK if you have a fixed timer setting that you always use.
If that were the case, then you wouldn’t be having trouble with trying to sleep it while the timer is on.
The timer will start charging any time during the charging window. It doesn’t only trip at the start time.
If that were the case, then you wouldn’t be having trouble with trying to sleep it while the timer is on.
The timer will start charging any time during the charging window. It doesn’t only trip at the start time.
#!/bin/bash
file="/tmp/ohmhour.active"
curl https://login.ohmconnect.com/verify-ohm-hour/[CODE] 2>/dev/null | xmllint --xpath '//ohmhour/active/text()' - | grep True > /dev/null
if [ $? == 0 ];
then
if [ -f "$file" ]
then
echo "ohmhour already detected"
else
echo "$(date) ohmhour started" >> /var/log/ohmhour.log
wget http://huzzah/r\?rapi=\$FS -O /dev/null
sleep 1
wget http://huzzah/r\?rapi=\$FD -O /dev/null
wget http://huzzah/r\?rapi=\$FB\ 3 -O /dev/null
touch $file
fi
exit 1
else
if [ -f "$file" ]
then
echo "$(date) Ohmhour ended" >> /var/log/ohmhour.log
wget http://huzzahr\?rapi=\$FS 2>&1 -O /dev/null
rm $file
exit 1
else
echo "no ohmour, nothing to see, move along"
fi
fi
There is a lot of space compared to the 328p on OpenEVSE. The Huzzah has a 4Mb flash chip. 1Mb is reserved for Programs and 3Mb is a file system. I have not even played with the file system yet. I plan to load some images and html files there and see if I can make a more modern UI. The latest versions of the Arduino ESP8266 tool has the libraries and examples for file system operations.
I am not sure what you mean about RAPI commands. Are you asking if we can create new commands that the Huzzah will read and in turn issue a different command or a series of commands?
I am not sure what you mean about RAPI commands. Are you asking if we can create new commands that the Huzzah will read and in turn issue a different command or a series of commands?
The reason ohmhour is not on the huzzah is the ohmconnect servers are using https. The Huzzah does support https but it is not yet part of the Arduino ESP8266 tools.
So either ohmconnect needs to accept the request and send the response http.
Or
We need to wait for https support from the Arduino ESP8266 team.
--
Used this script and it seemed to work ;-)
$ tail -f /var/log/ohmhour.log
Fri Nov 20 18:24:00 PST 2015 ohmhour started
Fri Nov 20 18:24:01 PST 2015 ohmhour started
Fri Nov 20 19:00:01 PST 2015 Ohmhour ended
Sun Nov 22 22:22:01 PST 2015 ohmhour started
Sun Nov 22 23:00:01 PST 2015 Ohmhour ended
Mon Nov 23 19:08:01 PST 2015 ohmhour started
Mon Nov 23 19:14:01 PST 2015 Ohmhour ended
Mon Nov 23 19:15:09 PST 2015 ohmhour started
Mon Nov 23 20:00:01 PST 2015 Ohmhour ended