积分 132
金钱 110
威望 0
贡献 0
HASS币 0
注册会员
积分 132
金钱 110
HASS币 0
homeassistant通过mqtt从nodered采集的数据每隔一段时间就发生一次突变,从曲线图上观察是一根、一根的柱子,请各位帮忙分析下是什么原因configuration.yaml内代码# Loads default set of integrations. Do not remove.default_config:
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
# Example configuration.yaml entry
mqtt:
sensor:
- name: "pvdianya"
state_topic: "home/mppt/pvdianya"
unit_of_measurement: "V"
value_template: "{{ value_json.pvdianya }}"
- name: "dianchidianya"
state_topic: "home/mppt/dianchidinaya"
unit_of_measurement: "V"
value_template: "{{ value_json.dianchidinaya }}"
- name: "chongdiandianliu"
state_topic: "home/mppt/chongdiandianliu"
unit_of_measurement: "A"
value_template: "{{ value_json.chongdiandianliu }}"
- name: "neibuwendu"
state_topic: "home/mppt/neibuwendu"
unit_of_measurement: "℃"
value_template: "{{ value_json.neibuwendu }}"
- name: "rifadianliang"
state_topic: "home/mppt/rifadianliang"
unit_of_measurement: "kWh"
value_template: "{{ value_json.rifadianliang }}"
- name: "zongdianliang"
state_topic: "home/mppt/zongdianliang"
unit_of_measurement: "kWh"
value_template: "{{ value_json.zongdianliang }}"
nodered的流程代码
[{"id":"930d15fae4d9fdc1","type":"tab","label":"流程 1","disabled":false,"info":"","env":[]},{"id":"e60015d31fb88ff5","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false},{"id":"35b0d312f4e9475d","type":"ui_base","theme":{"name":"theme-light","lightTheme":{"default":"#0094CE","baseColor":"#0094CE","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":false},"darkTheme":{"default":"#097479","baseColor":"#097479","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif","edited":false},"customTheme":{"name":"Untitled Theme 1","default":"#4B7930","baseColor":"#4B7930","baseFont":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"},"themeState":{"base-color":{"default":"#0094CE","value":"#0094CE","edited":false},"page-titlebar-backgroundColor":{"value":"#0094CE","edited":false},"page-backgroundColor":{"value":"#fafafa","edited":false},"page-sidebar-backgroundColor":{"value":"#ffffff","edited":false},"group-textColor":{"value":"#1bbfff","edited":false},"group-borderColor":{"value":"#ffffff","edited":false},"group-backgroundColor":{"value":"#ffffff","edited":false},"widget-textColor":{"value":"#111111","edited":false},"widget-backgroundColor":{"value":"#0094ce","edited":false},"widget-borderColor":{"value":"#ffffff","edited":false},"base-font":{"value":"-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"}},"angularTheme":{"primary":"indigo","accents":"blue","warn":"red","background":"grey","palette":"light"}},"site":{"name":"Node-RED Dashboard","hideToolbar":"false","allowSwipe":"false","lockMenu":"false","allowTempTheme":"true","dateFormat":"DD/MM/YYYY","sizes":{"sx":48,"sy":48,"gx":6,"gy":6,"cx":6,"cy":6,"px":0,"py":0}}},{"id":"2cdc47cd6915371c","type":"ui_group","name":"PV电压","tab":"e60015d31fb88ff5","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"0deee1014543e6d3","type":"mqtt-broker","name":"","broker":"127.0.0.1","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"autoUnsubscribe":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willRetain":"false","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""},{"id":"8ecf60a9f9d34c86","type":"udp in","z":"930d15fae4d9fdc1","name":"","iface":"","port":"9001","ipv":"udp4","multicast":"true","group":"192.168.0.113","datatype":"buffer","x":110,"y":160,"wires":[["a6e40735bf622686","475ab314c2acdace","82b0ded2ef9d3754","ca5f7b3790421b6c","129b692eed7cf1e9","9033a2a8d16f64d1","f5aad2f63fc9d937","dd9aeae21ea255da","548c141d1b72baea","a538b82cd4aaa1f1","184d52b2387ad00d","a349ab821bca2f61","c0c08d8d61ed3a7d"]]},{"id":"a6e40735bf622686","type":"debug","z":"930d15fae4d9fdc1","name":"debug 1","active":false,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":370,"y":340,"wires":[]},{"id":"4b8a52a2c866e271","type":"inject","z":"930d15fae4d9fdc1","name":"","props":[{"p":"payload"}],"repeat":"1","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"01 B3 01 00 00 00 00 B5","payloadType":"str","x":110,"y":240,"wires":[["1aad4a5fe55eac3d"]]},{"id":"1aad4a5fe55eac3d","type":"udp out","z":"930d15fae4d9fdc1","name":"","addr":"192.168.0.113","iface":"","port":"9001","ipv":"udp4","outport":"","base64":false,"multicast":"false","x":130,"y":320,"wires":[]},{"id":"475ab314c2acdace","type":"function","z":"930d15fae4d9fdc1","name":"PVdianya","func":"var a=parseInt('0x'+msg.payload.slice(6,8).toString('hex'))\nmsg.payload=a/10\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":340,"y":40,"wires":[["aef0cad9a8584b18","77b8753c685376dc","46392171c6020e1c"]]},{"id":"aef0cad9a8584b18","type":"debug","z":"930d15fae4d9fdc1","name":"debug 2","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":530,"y":40,"wires":[]},{"id":"82b0ded2ef9d3754","type":"function","z":"930d15fae4d9fdc1","name":"dianchidianya","func":"var a=parseInt('0x'+msg.payload.slice(8,10).toString('hex'))\nmsg.payload=a/100\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":360,"y":80,"wires":[["64c375e153928560"]]},{"id":"ca5f7b3790421b6c","type":"function","z":"930d15fae4d9fdc1","name":"chongdiandianliu","func":"var a=parseInt('0x'+msg.payload.slice(10,12).toString('hex'))\nmsg.payload=a/100\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":350,"y":120,"wires":[["200ac790a7625377"]]},{"id":"129b692eed7cf1e9","type":"function","z":"930d15fae4d9fdc1","name":"neibuwendu","func":"var a=parseInt('0x'+msg.payload.slice(12,14).toString('hex'))\nmsg.payload=a/10\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":350,"y":160,"wires":[["16977ff2021bf7f5"]]},{"id":"9033a2a8d16f64d1","type":"function","z":"930d15fae4d9fdc1","name":"rifadianliang","func":"var a=parseInt('0x'+msg.payload.slice(20,24).toString('hex'))\nmsg.payload=a/1000\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":350,"y":200,"wires":[["1eab386d71354f28"]]},{"id":"f5aad2f63fc9d937","type":"function","z":"930d15fae4d9fdc1","name":"zongdianliang","func":"var a=parseInt('0x'+msg.payload.slice(24,28).toString('hex'))\nmsg.payload=a/1000\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":360,"y":240,"wires":[["ef81c12fa5da198f"]]},{"id":"64c375e153928560","type":"debug","z":"930d15fae4d9fdc1","name":"debug 3","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":530,"y":80,"wires":[]},{"id":"200ac790a7625377","type":"debug","z":"930d15fae4d9fdc1","name":"debug 4","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":530,"y":120,"wires":[]},{"id":"16977ff2021bf7f5","type":"debug","z":"930d15fae4d9fdc1","name":"debug 5","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":530,"y":160,"wires":[]},{"id":"1eab386d71354f28","type":"debug","z":"930d15fae4d9fdc1","name":"debug 6","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":530,"y":200,"wires":[]},{"id":"ef81c12fa5da198f","type":"debug","z":"930d15fae4d9fdc1","name":"debug 7","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":530,"y":240,"wires":[]},{"id":"77b8753c685376dc","type":"ui_gauge","z":"930d15fae4d9fdc1","name":"","group":"2cdc47cd6915371c","order":0,"width":0,"height":0,"gtype":"gage","title":"gauge","label":"units","format":"{{value}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","diff":false,"className":"","x":710,"y":20,"wires":[]},{"id":"46392171c6020e1c","type":"ui_chart","z":"930d15fae4d9fdc1","name":"","group":"2cdc47cd6915371c","order":1,"width":0,"height":0,"label":"chart","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":830,"y":20,"wires":[[]]},{"id":"c375897d14527939","type":"mqtt out","z":"930d15fae4d9fdc1","name":"","topic":"","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"0deee1014543e6d3","x":930,"y":340,"wires":[]},{"id":"dd9aeae21ea255da","type":"function","z":"930d15fae4d9fdc1","name":"电池电压UI","func":"var a=parseInt('0x'+msg.payload.slice(8,10).toString('hex'))\nmsg.topic = \"home/mppt/dianchidinaya\"\nmsg.payload = {\"dianchidinaya\":a/100}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":710,"y":340,"wires":[["c375897d14527939"]]},{"id":"548c141d1b72baea","type":"function","z":"930d15fae4d9fdc1","name":"PV电压UI","func":"var a=parseInt('0x'+msg.payload.slice(6,8).toString('hex'))\nmsg.topic = \"home/mppt/pvdianya\"\nmsg.payload = {\"pvdianya\":a/10}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":700,"y":300,"wires":[["c375897d14527939"]]},{"id":"a538b82cd4aaa1f1","type":"function","z":"930d15fae4d9fdc1","name":"充电电流UI","func":"var a=parseInt('0x'+msg.payload.slice(10,12).toString('hex'))\nmsg.topic = \"home/mppt/chongdiandianliu\"\nmsg.payload = {\"chongdiandianliu\":a/100}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":710,"y":380,"wires":[["c375897d14527939"]]},{"id":"184d52b2387ad00d","type":"function","z":"930d15fae4d9fdc1","name":"内部温度UI","func":"var a=parseInt('0x'+msg.payload.slice(12,14).toString('hex'))\nmsg.topic = \"home/mppt/neibuwendu\"\nmsg.payload = {\"neibuwendu\":a/10}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":710,"y":420,"wires":[["c375897d14527939"]]},{"id":"a349ab821bca2f61","type":"function","z":"930d15fae4d9fdc1","name":"日发电量UI","func":"var a=parseInt('0x'+msg.payload.slice(20,24).toString('hex'))\nmsg.topic = \"home/mppt/rifadianliang\"\nmsg.payload = { \"rifadianliang\": a / 1000 }\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":710,"y":460,"wires":[["c375897d14527939"]]},{"id":"c0c08d8d61ed3a7d","type":"function","z":"930d15fae4d9fdc1","name":"总电量UI","func":"var a=parseInt('0x'+msg.payload.slice(24,28).toString('hex'))\nmsg.topic = \"home/mppt/zongdianliang\"\nmsg.payload = { \"zongdianliang\": a / 1000 }\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":700,"y":500,"wires":[["c375897d14527939"]]}]