Pages

Monday, December 1, 2014

Workflow which to be Started at the External Environment Changes, e.g. "Power Utilization"

'Checking every an hour... 10 times a day...' (Loop)

It is really annoying though, I have to do... Since we are a public institution, so we must take the initiative to perform "Power saving". The checking operation I mentioned before, is about "power usage" which the electric power firm announces. Alert when the actual value of 1 hour average exceeds 89%, and if it exceeds 94%, 1) Turn off MFP and the shredder, 2) Turn off the hot water supply machine, 3) Turn off the office lighting, 4) Stop the elevator, etc..

Since '3.11' in 2011 (Earthquake & nuclear accident), power firms in Japan are publishing 'power usage' every 3 minutes (or 5). Despite in autumn or winter other than midsummer, the usage exceeds 90% once or twice a month.

Indeed, 'People who are really need the power' should be priority, but frankly, it is an annoying job. Even though I'm using Twitter and Email notification service, they don't totally fit our business. I wonder if I could manage, using APIs?

[Power Saving Procedure flow]



[Power Saving Procedure flow: 'Power Savings' screen]

Aha,,, to check the 'power usage', I may also see the websites of each power firm, but I can obtain the data automatically, for Yahoo! Japan has published the APIs.

For example, I tried to throw HTTP Request at 10 minute of every hour, then I got the response as follows.

http://setsuden.yahooapis.jp/v1/Setsuden/latestPowerUsage?appid=<your application ID>&output=json&area=tokyo

{"ElectricPowerUsage": {
"Area":"tokyo",
"Usage":{"@unit":"kW","$":38340000},
"Capacity":{"@unit":"kW","$":45870000},
"Date":"2014-11-25","Hour":18}
}

So that, I can calculate the 'power usage' using Script based on 'usage' and 'capacity'. Well, automation of workflow is really convenient. This also reduces "human work" a little.

By the way, automation of this kind requires, not a full-fledged programming knowledge, but some skills enough to write a simple script.

P.s. About a case that power usage would suddenly exceed 94%, I will write in the next issue.

[Data Items List]

<Sample script: Set of Power Usage>


[Free Download]
<Similar Models>
<<Related Articles>>