Can you post your entities code by any chance? I’ve been struggling with trying to get the data to get represented in a histogram, but it only wants to show me a bar graph…
[
{
"id": "679fbd256c1ec156",
"type": "inject",
"z": "4a88c65d5156b41a",
"name": "Website version",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "7200",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 130,
"y": 320,
"wires": [
[
"1819507890ac02e0"
]
]
},
{
"id": "1819507890ac02e0",
"type": "http request",
"z": "4a88c65d5156b41a",
"name": "Get Session Cookie",
"method": "GET",
"ret": "txt",
"paytoqs": "ignore",
"url": "https://app.smartoilgauge.com/login.php",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"x": 140,
"y": 360,
"wires": [
[
"4fb8a0f4e7819484"
]
]
},
{
"id": "4fb8a0f4e7819484",
"type": "function",
"z": "4a88c65d5156b41a",
"name": "LOGIN CONFIG HERE",
"func": "var smartOilUser = \"[email protected]\";\nvar smartOilPassword = \"YourPassword\";\nvar cookies = msg.responseCookies;\nvar cff_nonce = msg.payload.match(\"(?<=name='ccf_nonce' value=')(?:[^']|'')*(?=')\");\nmsg.headers = {\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n \"Cookie\" : \"PHPSESSID=\" + cookies.PHPSESSID.value,\n \"User-Agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36\"\n};\n\nmsg.payload = \"username=\" + smartOilUser + \"&user_pass=\" + smartOilPassword + \"&ccf_nonce=\"+cff_nonce[0];\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 140,
"y": 400,
"wires": [
[
"e1b71817c7ef2a23"
]
]
},
{
"id": "e1b71817c7ef2a23",
"type": "http request",
"z": "4a88c65d5156b41a",
"name": "Login to the smartoil website",
"method": "POST",
"ret": "txt",
"paytoqs": "ignore",
"url": "https://app.smartoilgauge.com/app.php",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"x": 160,
"y": 440,
"wires": [
[
"1c8ac8aee89e36fa"
]
]
},
{
"id": "a7124ae6be1f3c0c",
"type": "http request",
"z": "4a88c65d5156b41a",
"name": "Scrape website for info",
"method": "POST",
"ret": "obj",
"paytoqs": "ignore",
"url": "https://app.smartoilgauge.com/ajax/main_ajax.php",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"x": 150,
"y": 520,
"wires": [
[
"48570d654a9c6c55"
]
]
},
{
"id": "1c8ac8aee89e36fa",
"type": "function",
"z": "4a88c65d5156b41a",
"name": "Prepare query",
"func": "var cookies = msg.responseCookies\nmsg.headers = {\n\"X-Requested-With\": \"XMLHttpRequest\",\n\"Content-Type\": \"application/x-www-form-urlencoded\",\n\"User-Agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.55 Safari/537.36\",\n\"Cookie\" : \"PHPSESSID=\" + cookies.PHPSESSID.value\n};\nmsg.payload = {\n \"action\": \"get_tanks_list\",\n \"tank_id\": \"0\"\n};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 120,
"y": 480,
"wires": [
[
"a7124ae6be1f3c0c"
]
]
},
{
"id": "48570d654a9c6c55",
"type": "function",
"z": "4a88c65d5156b41a",
"name": "Extract required data here",
"func": "node.status({text:msg.payload.tanks[0].sensor_rt + \" gal: \" + msg.payload.tanks[0].sensor_gallons});\nmsg.payload = Number(msg.payload.tanks[0].sensor_gallons);\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 150,
"y": 560,
"wires": [
[
"13b148a7503d5fc7"
]
]
},
{
"id": "13b148a7503d5fc7",
"type": "ha-entity",
"z": "4a88c65d5156b41a",
"name": "GasLevel",
"server": "e0ae21e440ba5f41",
"version": 2,
"debugenabled": false,
"outputs": 1,
"entityType": "sensor",
"config": [
{
"property": "name",
"value": ""
},
{
"property": "device_class",
"value": "gas"
},
{
"property": "icon",
"value": ""
},
{
"property": "unit_of_measurement",
"value": ""
},
{
"property": "state_class",
"value": ""
},
{
"property": "last_reset",
"value": ""
}
],
"state": "payload",
"stateType": "msg",
"attributes": [],
"resend": true,
"outputLocation": "payload",
"outputLocationType": "none",
"inputOverride": "allow",
"outputOnStateChange": false,
"outputPayload": "",
"outputPayloadType": "str",
"x": 400,
"y": 560,
"wires": [
[]
]
},
{
"id": "e0ae21e440ba5f41",
"type": "server",
"name": "Home Assistant",
"version": 2,
"addon": false,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": true,
"cacheJson": true,
"heartbeat": false,
"heartbeatInterval": "30"
}
]