thanks for your work I’ve been using the workflow for 2 weeks but now I think they changed the Oilfox API: customer-api/docs/v1 at main · foxinsights/customer-api · GitHub
I’ve adjusted your workflow, it should work again now:
(Change
in “Login” → user, pw
and
in “Get Summary” → device-number (-> see Oilfox-App):
Also you need this node: node-red-contrib-http-request (node) - Node-RED
[{"id":"3079ee36.02c2d2","type":"tab","label":"Oilfox","disabled":false,"info":""},{"id":"a211bae9.c4bc88","type":"change","z":"3079ee36.02c2d2","name":"Befehl: Tokenabruf ","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"email\":\"xxxx\",\"password\":\"xxxxx\"}","tot":"json"},{"t":"set","p":"headers","pt":"msg","to":"{\"Content-Type\":\"application/json\"}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":40,"wires":[["a8d341648efcb13b"]]},{"id":"c376eaa0f7c9dc9f","type":"debug","z":"3079ee36.02c2d2","name":"curl","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":850,"y":40,"wires":[]},{"id":"e26c9ba4042d6762","type":"json","z":"3079ee36.02c2d2","name":"Token parsing","property":"payload","action":"","pretty":true,"x":140,"y":120,"wires":[["be5e9539112e31bc"]]},{"id":"4d3699a8c494fd22","type":"debug","z":"3079ee36.02c2d2","name":"Token","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":850,"y":120,"wires":[]},{"id":"be5e9539112e31bc","type":"change","z":"3079ee36.02c2d2","name":"Headers & Auth","rules":[{"t":"set","p":"headers","pt":"msg","to":"{\t \"Authorization\" : payload.token_type & \" \" & payload.access_token,\t \"Content-Type\" : \"application/json\"\t}","tot":"jsonata"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":120,"wires":[["4d3699a8c494fd22","7a4956b43451d665"]]},{"id":"e90d148f71e213d8","type":"debug","z":"3079ee36.02c2d2","name":"Summary","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":860,"y":180,"wires":[]},{"id":"596c4fad6ca9bae1","type":"json","z":"3079ee36.02c2d2","name":"Summary parsing","property":"payload","action":"","pretty":true,"x":410,"y":180,"wires":[["e90d148f71e213d8","70ee284899ec8fbf","ec1a249b0e7cfca4"]]},{"id":"70ee284899ec8fbf","type":"ha-entity","z":"3079ee36.02c2d2","name":"OilFox Fill Percentage","server":"fbb2f3e2.d6216","version":2,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"OilFox Fill Percentage"},{"property":"device_class","value":"mdi:oil-level"},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"%"},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"state":"payload.fillLevelPercent","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":640,"y":240,"wires":[["c952810034ee570c"]]},{"id":"c952810034ee570c","type":"debug","z":"3079ee36.02c2d2","name":"Entity Percent","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":880,"y":260,"wires":[]},{"id":"ec1a249b0e7cfca4","type":"ha-entity","z":"3079ee36.02c2d2","name":"OilFox_Fuellstand_heute","server":"fbb2f3e2.d6216","version":2,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"oilfox_fuellstand_heute"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"l"},{"property":"state_class","value":""},{"property":"last_reset","value":""}],"state":"payload.fillLevelQuantity","stateType":"msg","attributes":[{"property":"letzteMessung","value":"payload.currentMeteringAt","valueType":"msg"},{"property":"naechsteMessung","value":"payload.nextMeteringAt","valueType":"msg"},{"property":"battery","value":"payload.batteryLevel","valueType":"msg"},{"property":"unit","value":"payload.quantityUnit","valueType":"msg"},{"property":"daysReach","value":"payload.daysReach","valueType":"msg"}],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":650,"y":320,"wires":[["b828611b0ad5db4d"]]},{"id":"b828611b0ad5db4d","type":"debug","z":"3079ee36.02c2d2","name":"Entity Liters","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":870,"y":320,"wires":[]},{"id":"2852886dd0231d1a","type":"inject","z":"3079ee36.02c2d2","name":"00:05 Uhr","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"05 00 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":40,"wires":[["a211bae9.c4bc88"]]},{"id":"a8d341648efcb13b","type":"www-request","z":"3079ee36.02c2d2","name":"Login","method":"POST","ret":"txt","url":"https://api.oilfox.io/customer-api/v1/login","follow-redirects":true,"persistent-http":true,"tls":"","x":620,"y":40,"wires":[["c376eaa0f7c9dc9f","e26c9ba4042d6762"]]},{"id":"7a4956b43451d665","type":"www-request","z":"3079ee36.02c2d2","name":"Get Summary","method":"GET","ret":"txt","url":"https://api.oilfox.io/customer-api/v1/device/[xxxx]","follow-redirects":true,"persistent-http":true,"tls":"","x":140,"y":180,"wires":[["596c4fad6ca9bae1"]]},{"id":"fbb2f3e2.d6216","type":"server","name":"Home Assistant","version":1,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
credits also goes to: Get Your Personal Oil Well Level – Integrating OilFox Into Home Assistant using node-red – MolesBlog