『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 3098|回复: 21

[技术探讨] homeassistant数据畸形

[复制链接]

3

主题

22

帖子

132

积分

注册会员

Rank: 2

积分
132
金钱
110
HASS币
0
发表于 2023-12-12 12:39:24 | 显示全部楼层 |阅读模式
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"]]}]

homeassistant数据突变图.jpg
nodered流程图.jpg
回复

使用道具 举报

3

主题

22

帖子

132

积分

注册会员

Rank: 2

积分
132
金钱
110
HASS币
0
 楼主| 发表于 2023-12-12 12:41:14 | 显示全部楼层
另外请教下为啥nodered的ui界面登录不进去,总是提示输入用户名,密码,能想到的用户名和密码都尝试了还是登录失败
回复

使用道具 举报

23

主题

656

帖子

4613

积分

元老级技术达人

积分
4613
金钱
3942
HASS币
30

教程狂人

QQ
发表于 2023-12-12 13:58:55 | 显示全部楼层
应该是有异常的数据吧,这数据都上百万了,正常的数据也就几十,图表上肯定显示不出来了。NR密码忘了可以在控制台重置
回复

使用道具 举报

3

主题

22

帖子

132

积分

注册会员

Rank: 2

积分
132
金钱
110
HASS币
0
 楼主| 发表于 2023-12-12 14:38:13 | 显示全部楼层
alei643 发表于 2023-12-12 13:58
应该是有异常的数据吧,这数据都上百万了,正常的数据也就几十,图表上肯定显示不出来了。NR密码忘了可以在 ...

file:///C:/Users/chenxiaowei/Desktop/%E6%9B%B4%E6%94%B9nr%E5%AF%86%E7%A0%81.png    是修改这俩吗   改过了  也不行 提示这个file:///C:/Users/chenxiaowei/Desktop/%E5%AF%86%E7%A0%81%E6%8F%90%E7%A4%BA.png
回复

使用道具 举报

3

主题

22

帖子

132

积分

注册会员

Rank: 2

积分
132
金钱
110
HASS币
0
 楼主| 发表于 2023-12-12 14:39:49 | 显示全部楼层
不好意思  上面的图片没搞好
更改nr密码.png
密码提示.png
回复

使用道具 举报

3

主题

22

帖子

132

积分

注册会员

Rank: 2

积分
132
金钱
110
HASS币
0
 楼主| 发表于 2023-12-12 16:11:21 | 显示全部楼层
alei643 发表于 2023-12-12 13:58
应该是有异常的数据吧,这数据都上百万了,正常的数据也就几十,图表上肯定显示不出来了。NR密码忘了可以在 ...

数据是异常的,nr调试窗口的数据2023/12/12 16:08:26节点: debug 6
msg.payload : number
3217014.207
2023/12/12 16:08:26节点: debug 7
msg.payload : number
3221224.443
2023/12/12 16:08:26节点: debug 2
msg.payload : number
0
2023/12/12 16:08:26节点: debug 3
msg.payload : number
49.91
2023/12/12 16:08:26节点: debug 4
msg.payload : number
0
2023/12/12 16:08:26节点: debug 5
msg.payload : number
17.1
2023/12/12 16:08:26节点: debug 6
msg.payload : number
4294957.977
2023/12/12 16:08:26节点: debug 7
msg.payload : number
3221225.467
2023/12/12 16:08:26节点: debug 2
msg.payload : number
0.1
2023/12/12 16:08:26节点: debug 3
msg.payload : number
49.91
2023/12/12 16:08:26节点: debug 4
msg.payload : number
0
请教下这个有对应的节点对数据进行范围约束吗?
回复

使用道具 举报

23

主题

656

帖子

4613

积分

元老级技术达人

积分
4613
金钱
3942
HASS币
30

教程狂人

QQ
发表于 2023-12-12 16:11:38 | 显示全部楼层
没用过商店的,我用Docker,这两项都留空试试
回复

使用道具 举报

23

主题

656

帖子

4613

积分

元老级技术达人

积分
4613
金钱
3942
HASS币
30

教程狂人

QQ
发表于 2023-12-12 16:19:36 | 显示全部楼层
chenxiaowei 发表于 2023-12-12 16:11
数据是异常的,nr调试窗口的数据2023/12/12 16:08:26节点: debug 6
msg.payload : number
3217014.207

可以用filter节点过滤一下
回复

使用道具 举报

77

主题

1391

帖子

2万

积分

元老级技术达人

积分
24349
金钱
22918
HASS币
290
发表于 2023-12-12 19:01:50 | 显示全部楼层
本帖最后由 dscao 于 2023-12-12 19:08 编辑
chenxiaowei 发表于 2023-12-12 14:39
不好意思  上面的图片没搞好

配置的密码是给http节点用的

UI我还没用过,刚试了一下,与上面配置的密码一样就进入了。
不过hassos中的这个地址是: http://192.168.x.xx:1880/endpoint/ui/  使用节点的用户名密码
回复

使用道具 举报

4

主题

144

帖子

1253

积分

金牌会员

Rank: 6Rank: 6

积分
1253
金钱
1109
HASS币
0
发表于 2023-12-12 19:29:57 | 显示全部楼层
chenxiaowei 发表于 2023-12-12 14:39
不好意思  上面的图片没搞好

直接用你homeassistant的管理员帐号密码即可
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-25 20:39 , Processed in 0.079344 second(s), 36 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表