[
{
"id": "d421b9ba0766c3a9",
"type": "tab",
"label": "油价",
"disabled": false,
"info": "",
"env": []
},
{
"id": "e8e943f5de1abc3f",
"type": "inject",
"z": "d421b9ba0766c3a9",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "14400",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 200,
"y": 200,
"wires": [
[
"7282855c93a546a1",
"16aac348e3c27db8"
]
]
},
{
"id": "7282855c93a546a1",
"type": "http request",
"z": "d421b9ba0766c3a9",
"name": "",
"method": "GET",
"ret": "txt",
"paytoqs": "ignore",
"url": "http://www.qiyoujiage.com/shandong/jinan.shtml",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "",
"senderr": false,
"headers": [],
"x": 400,
"y": 200,
"wires": [
[
"8e042617a206c71b",
"6e9eacff9401b324"
]
]
},
{
"id": "8e042617a206c71b",
"type": "html",
"z": "d421b9ba0766c3a9",
"name": "",
"property": "payload",
"outproperty": "payload",
"tag": "#youjia > dl",
"ret": "text",
"as": "single",
"x": 570,
"y": 200,
"wires": [
[
"da99b102b1838e40"
]
]
},
{
"id": "da99b102b1838e40",
"type": "split",
"z": "d421b9ba0766c3a9",
"name": "",
"splt": "\\n",
"spltType": "str",
"arraySplt": 1,
"arraySpltType": "len",
"stream": false,
"addname": "",
"x": 710,
"y": 200,
"wires": [
[
"dfb1f4c74d08f35b"
]
]
},
{
"id": "dfb1f4c74d08f35b",
"type": "switch",
"z": "d421b9ba0766c3a9",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "cont",
"v": "92#",
"vt": "str"
},
{
"t": "cont",
"v": "95#",
"vt": "str"
},
{
"t": "cont",
"v": "98#",
"vt": "str"
},
{
"t": "cont",
"v": "0#",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 4,
"x": 830,
"y": 200,
"wires": [
[
"4e62104a0afdb9ef"
],
[
"7221463aedda161b"
],
[
"38dc4898932a5ec4"
],
[
"2923da012cd5c84b"
]
]
},
{
"id": "4e62104a0afdb9ef",
"type": "split",
"z": "d421b9ba0766c3a9",
"name": "",
"splt": "\\n",
"spltType": "str",
"arraySplt": "4",
"arraySpltType": "len",
"stream": true,
"addname": "topic",
"x": 1030,
"y": 140,
"wires": [
[
"f8aeae44f661a801"
]
]
},
{
"id": "7221463aedda161b",
"type": "split",
"z": "d421b9ba0766c3a9",
"name": "",
"splt": "\\n",
"spltType": "str",
"arraySplt": "4",
"arraySpltType": "len",
"stream": true,
"addname": "topic",
"x": 1030,
"y": 180,
"wires": [
[
"d884ac304fda8635"
]
]
},
{
"id": "38dc4898932a5ec4",
"type": "split",
"z": "d421b9ba0766c3a9",
"name": "",
"splt": "\\n",
"spltType": "str",
"arraySplt": "4",
"arraySpltType": "len",
"stream": true,
"addname": "topic",
"x": 1030,
"y": 220,
"wires": [
[
"d9e3c8d2c27bde74"
]
]
},
{
"id": "2923da012cd5c84b",
"type": "split",
"z": "d421b9ba0766c3a9",
"name": "",
"splt": "\\n",
"spltType": "str",
"arraySplt": "4",
"arraySpltType": "len",
"stream": true,
"addname": "topic",
"x": 1030,
"y": 260,
"wires": [
[
"078692d7b5644302"
]
]
},
{
"id": "f8aeae44f661a801",
"type": "change",
"z": "d421b9ba0766c3a9",
"name": "",
"rules": [
{
"t": "set",
"p": "92#",
"pt": "global",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1260,
"y": 140,
"wires": [
[
"1ad9c828fb48a3f0"
]
]
},
{
"id": "d884ac304fda8635",
"type": "change",
"z": "d421b9ba0766c3a9",
"name": "",
"rules": [
{
"t": "set",
"p": "95#",
"pt": "global",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1260,
"y": 180,
"wires": [
[
"1ad9c828fb48a3f0"
]
]
},
{
"id": "d9e3c8d2c27bde74",
"type": "change",
"z": "d421b9ba0766c3a9",
"name": "",
"rules": [
{
"t": "set",
"p": "98#",
"pt": "global",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1260,
"y": 220,
"wires": [
[
"1ad9c828fb48a3f0"
]
]
},
{
"id": "078692d7b5644302",
"type": "change",
"z": "d421b9ba0766c3a9",
"name": "",
"rules": [
{
"t": "set",
"p": "0#",
"pt": "global",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1260,
"y": 260,
"wires": [
[
"1ad9c828fb48a3f0"
]
]
},
{
"id": "6e9eacff9401b324",
"type": "html",
"z": "d421b9ba0766c3a9",
"name": "",
"property": "payload",
"outproperty": "payload",
"tag": "#youjiaCont > div",
"ret": "text",
"as": "single",
"x": 590,
"y": 300,
"wires": [
[
"bdf6b17e31eb5bba"
]
]
},
{
"id": "bdf6b17e31eb5bba",
"type": "change",
"z": "d421b9ba0766c3a9",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload[1]",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 810,
"y": 300,
"wires": [
[
"84d44bfec1dc5014"
]
]
},
{
"id": "84d44bfec1dc5014",
"type": "split",
"z": "d421b9ba0766c3a9",
"name": "",
"splt": "\\n",
"spltType": "str",
"arraySplt": 1,
"arraySpltType": "len",
"stream": false,
"addname": "",
"x": 990,
"y": 300,
"wires": [
[
"82d78b1f9aa34bb3"
]
]
},
{
"id": "82d78b1f9aa34bb3",
"type": "join",
"z": "d421b9ba0766c3a9",
"name": "",
"mode": "custom",
"build": "array",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": false,
"timeout": "",
"count": "",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "",
"reduceFixup": "",
"x": 1110,
"y": 300,
"wires": [
[
"1e914c0e3c884128"
]
]
},
{
"id": "1e914c0e3c884128",
"type": "change",
"z": "d421b9ba0766c3a9",
"name": "",
"rules": [
{
"t": "set",
"p": "tips",
"pt": "global",
"to": "payload[2]",
"tot": "msg"
},
{
"t": "set",
"p": "state",
"pt": "global",
"to": "payload[1]",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1260,
"y": 300,
"wires": [
[
"1ad9c828fb48a3f0"
]
]
},
{
"id": "1ad9c828fb48a3f0",
"type": "ha-sensor",
"z": "d421b9ba0766c3a9",
"name": "油价",
"entityConfig": "f85338be9197e1a4",
"version": 0,
"state": "state",
"stateType": "global",
"attributes": [
{
"property": "92#",
"value": "92#",
"valueType": "global"
},
{
"property": "95#",
"value": "95#",
"valueType": "global"
},
{
"property": "98#",
"value": "98#",
"valueType": "global"
},
{
"property": "0#",
"value": "0#",
"valueType": "global"
},
{
"property": "tips",
"value": "tips",
"valueType": "global"
},
{
"property": "time",
"value": "time",
"valueType": "global"
}
],
"inputOverride": "allow",
"outputProperties": [],
"x": 1500,
"y": 200,
"wires": [
[]
]
},
{
"id": "16aac348e3c27db8",
"type": "function",
"z": "d421b9ba0766c3a9",
"name": "function",
"func": "function timestampToTime(timestamp) {\n var date = new Date(timestamp);\n var Y = date.getFullYear() + '-';\n var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';\n var D = date.getDate() + ' ';\n var h = date.getHours() + ':';\n var m = date.getMinutes() + ':';\n var s = date.getSeconds();\n return Y + M + D + h + m + s;\n}\n\nvar data_t = {\n payload: timestampToTime(msg.payload)\n}\n\nreturn data_t;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 400,
"y": 100,
"wires": [
[
"2b8afe59f039c26f"
]
]
},
{
"id": "2b8afe59f039c26f",
"type": "change",
"z": "d421b9ba0766c3a9",
"name": "",
"rules": [
{
"t": "set",
"p": "time",
"pt": "global",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1260,
"y": 100,
"wires": [
[
"1ad9c828fb48a3f0"
]
]
},
{
"id": "f85338be9197e1a4",
"type": "ha-entity-config",
"server": "2564e51e05f374f6",
"deviceConfig": "",
"name": "sensor config for 油价",
"version": "6",
"entityType": "sensor",
"haConfig": [
{
"property": "name",
"value": "youjia"
},
{
"property": "icon",
"value": "mdi:gas-station"
},
{
"property": "entity_category",
"value": ""
},
{
"property": "device_class",
"value": ""
},
{
"property": "unit_of_measurement",
"value": ""
},
{
"property": "state_class",
"value": ""
}
],
"resend": true
},
{
"id": "2564e51e05f374f6",
"type": "server",
"name": "Home Assistant",
"version": 5,
"addon": false,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": true,
"cacheJson": true,
"heartbeat": false,
"heartbeatInterval": "30",
"areaSelector": "friendlyName",
"deviceSelector": "friendlyName",
"entitySelector": "friendlyName",
"statusSeparator": ": ",
"statusYear": "hidden",
"statusMonth": "short",
"statusDay": "numeric",
"statusHourCycle": "default",
"statusTimeFormat": "h:m",
"enableGlobalContextStore": false
}
]