1) Give a description of the problem
Working on a piston to consume ComEd’s current hour average price, available in json format at https://hourlypricing.comed.com/api?type=currenthouraverage
2) What is the expected behaviour?
I am able to log the response, but not access the json path, specifically the price element. Here’s an example of the format:
[{"millisUTC":"1565039700000","price":"3.1"}]
I thought $response[0].price would work, but it doesn’t.
3) What is happening/not happening?
Error retrieving json data part null
4) Post a Green Snapshot of the piston
5) Attach logs after turning logging level to Full
8/5/2019, 5:57:04 PM +795ms
+1ms ╔Received event [Home].test = 1565045824795 with a delay of 0ms
+91ms ║RunTime Analysis CS > 19ms > PS > 59ms > PE > 13ms > CE
+94ms ║Runtime (38022 bytes) successfully initialized in 59ms (v0.3.10a.20190223) (92ms)
+95ms ║╔Execution stage started
+102ms ║║Cancelling statement #1’s schedules…
+115ms ║║Sending external web request to: hourlypricing.comed.com/api?type=currenthouraverage&format=json
+342ms ║║Executed virtual command httpRequest (229ms)
+348ms ║║[{“millisUTC”:“1565045400000”,“price”:“3.5”}]
+349ms ║║Executed virtual command log (1ms)
+354ms ║║Error retrieving JSON data part null
+358ms ║║Executed virtual command log (1ms)
+360ms ║╚Execution stage complete. (265ms)
+362ms ╚Event processed successfully (361ms)