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

 找回密码
 立即注册
查看: 1930|回复: 7

[技术探讨] 各位老师,厂家自定义报文如何接入homeassistant

[复制链接]

3

主题

22

帖子

132

积分

注册会员

Rank: 2

积分
132
金钱
110
HASS币
0
发表于 2023-11-8 09:38:03 | 显示全部楼层 |阅读模式
我的一个mppt光伏控制器,有rs485接口,我想通过汉枫EW11的dtu设备(支持tcp、udp、mqtt、ali等)将报文传输到homeassistant上并解析,采集PV电压、电流、电瓶电压等数据,因为厂家的不是modbus协议,有什么方法能实现吗?之前通过EW11自动发查询报文,报文自动上传过阿里云,这个与aliyun有没有类似的方式,谢谢

EW11自动轮询代码.pdf

50.15 KB, 下载次数: 10

阿里云解析代码B1.pdf

121.19 KB, 下载次数: 8

Elfin-EW1X_用户手册V1.3(20200415).rar

993.4 KB, 下载次数: 7

1575854784MPPT远程通信协议.pdf

899.42 KB, 下载次数: 24

回复

使用道具 举报

8

主题

73

帖子

723

积分

高级会员

Rank: 4

积分
723
金钱
650
HASS币
30
发表于 2023-11-8 11:21:14 | 显示全部楼层
自己用python写脚本,或者用nodered
回复

使用道具 举报

3

主题

22

帖子

132

积分

注册会员

Rank: 2

积分
132
金钱
110
HASS币
0
 楼主| 发表于 2023-11-9 16:48:35 | 显示全部楼层
jijngpengboo 发表于 2023-11-8 11:21
自己用python写脚本,或者用nodered

我尝试用chatgpt写下脚本
回复

使用道具 举报

5

主题

39

帖子

290

积分

中级会员

Rank: 3Rank: 3

积分
290
金钱
251
HASS币
0
发表于 2024-1-29 16:43:58 | 显示全部楼层
这个是是国内的mppt,钰辉,聚源可能都是这样子。带有脚本,协议文件。闲鱼有人卖Nodered的,我见过有人写过脚本,成esphome.
回复

使用道具 举报

3

主题

22

帖子

132

积分

注册会员

Rank: 2

积分
132
金钱
110
HASS币
0
 楼主| 发表于 2024-2-29 11:00:57 | 显示全部楼层
sayinzest 发表于 2024-1-29 16:43
这个是是国内的mppt,钰辉,聚源可能都是这样子。带有脚本,协议文件。闲鱼有人卖Nodered的,我见过有人写过 ...

我是这么搞的
1709175579650.png
回复

使用道具 举报

5

主题

39

帖子

290

积分

中级会员

Rank: 3Rank: 3

积分
290
金钱
251
HASS币
0
发表于 2024-3-28 00:42:44 | 显示全部楼层

感谢回复,能在这个地方写成教程吗?
我有个朋友在闲鱼买了Nodered方案的,忽略协议文件。万分感谢。
回复

使用道具 举报

3

主题

22

帖子

132

积分

注册会员

Rank: 2

积分
132
金钱
110
HASS币
0
 楼主| 发表于 2024-4-16 13:30:42 | 显示全部楼层
sayinzest 发表于 2024-3-28 00:42
感谢回复,能在这个地方写成教程吗?
我有个朋友在闲鱼买了Nodered方案的,忽略协议文件。万分感谢。:han ...

nodered 的json代码
[{"id":"d14665f497560d19","type":"tab","label":"光伏系统接入流程","disabled":false,"info":"","env":[]},{"id":"a35acba689cdbe0e","type":"udp in","z":"d14665f497560d19","name":"","iface":"","port":"9001","ipv":"udp4","multicast":"true","group":"192.168.0.113","datatype":"buffer","x":110,"y":160,"wires":[["72066336fc92b74c","61c45291f82cc5b1","f347c1924ac103a3","034155a3dbe89283","daabb3e447c51431","b1ce9e7802162dba","cd5add002343319a","28be618f873f23c4","092c71e7ed7a7245"]]},{"id":"72066336fc92b74c","type":"debug","z":"d14665f497560d19","name":"debug 1","active":false,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":350,"y":460,"wires":[]},{"id":"7e23bf5243368ab5","type":"inject","z":"d14665f497560d19","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":120,"y":500,"wires":[["1bc5bb45221126bc"]]},{"id":"1bc5bb45221126bc","type":"udp out","z":"d14665f497560d19","name":"","addr":"192.168.0.113","iface":"","port":"9001","ipv":"udp4","outport":"","base64":false,"multicast":"false","x":390,"y":560,"wires":[]},{"id":"61c45291f82cc5b1","type":"function","z":"d14665f497560d19","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":[["22023b3a42c7ab29"]]},{"id":"4e319e06fb193afe","type":"debug","z":"d14665f497560d19","name":"debug 2","active":false,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":850,"y":60,"wires":[]},{"id":"f347c1924ac103a3","type":"function","z":"d14665f497560d19","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":[["2e56a49a1f146105"]]},{"id":"034155a3dbe89283","type":"function","z":"d14665f497560d19","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":[["31d68d25b1711316"]]},{"id":"daabb3e447c51431","type":"function","z":"d14665f497560d19","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":[["542d4a0cd3332f77"]]},{"id":"b1ce9e7802162dba","type":"function","z":"d14665f497560d19","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":[["f8872c135074e180"]]},{"id":"cd5add002343319a","type":"function","z":"d14665f497560d19","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":[["fef8c4cbbbf475f8"]]},{"id":"0d09d48106ccd2c9","type":"debug","z":"d14665f497560d19","name":"debug 3","active":false,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":850,"y":100,"wires":[]},{"id":"f53fa1b057720870","type":"debug","z":"d14665f497560d19","name":"debug 4","active":false,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":850,"y":140,"wires":[]},{"id":"972fb9d629e035d0","type":"debug","z":"d14665f497560d19","name":"debug 5","active":false,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":850,"y":180,"wires":[]},{"id":"24eb22efb8d20919","type":"debug","z":"d14665f497560d19","name":"debug 6","active":false,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":850,"y":220,"wires":[]},{"id":"5714c4e4add6fdbf","type":"debug","z":"d14665f497560d19","name":"debug 7","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":850,"y":260,"wires":[]},{"id":"f0366b94948ffda0","type":"ui_gauge","z":"d14665f497560d19","name":"PV电压","group":"2cdc47cd6915371c","order":2,"width":"0","height":"0","gtype":"gage","title":"PV电压","label":"units","format":"{{value}}","min":0,"max":"200","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","diff":false,"className":"","x":1120,"y":80,"wires":[]},{"id":"98345acc1a3f03c2","type":"ui_chart","z":"d14665f497560d19","name":"PV电压","group":"2cdc47cd6915371c","order":1,"width":"0","height":"0","label":"PV电压","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":1260,"y":100,"wires":[[]]},{"id":"5e643f2e1a99ebf5","type":"mqtt out","z":"d14665f497560d19","name":"","topic":"","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"0deee1014543e6d3","x":1070,"y":500,"wires":[]},{"id":"55bafdb7d99ba386","type":"function","z":"d14665f497560d19","name":"电池电压UI","func":"msg.topic = \"home/mppt/dianchidinaya\"\nmsg.payload = {\"dianchidinaya\":msg.payload}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":850,"y":440,"wires":[["5e643f2e1a99ebf5"]]},{"id":"08c27ca36ab4a8f0","type":"function","z":"d14665f497560d19","name":"PV电压UI","func":"msg.topic = \"home/mppt/pvdianya\"\nmsg.payload = {\"pvdianya\":msg.payload}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":840,"y":400,"wires":[["5e643f2e1a99ebf5"]]},{"id":"a479933d6ca7a835","type":"function","z":"d14665f497560d19","name":"充电电流UI","func":"msg.topic = \"home/mppt/chongdiandianliu\"\nmsg.payload = {\"chongdiandianliu\":msg.payload}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":850,"y":480,"wires":[["5e643f2e1a99ebf5"]]},{"id":"7f91e96abb6a64da","type":"function","z":"d14665f497560d19","name":"内部温度UI","func":"msg.topic = \"home/mppt/neibuwendu\"\nmsg.payload = {\"neibuwendu\":msg.payload }\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":850,"y":520,"wires":[["5e643f2e1a99ebf5"]]},{"id":"c44b5a63098091b5","type":"function","z":"d14665f497560d19","name":"日发电量UI","func":"msg.topic = \"home/mppt/rifadianliang\"\nmsg.payload = { \"rifadianliang\": msg.payload }\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":850,"y":560,"wires":[["5e643f2e1a99ebf5"]]},{"id":"4b70e3eddde66ad0","type":"function","z":"d14665f497560d19","name":"总电量UI","func":"msg.topic = \"home/mppt/zongdianliang\"\nmsg.payload = { \"zongdianliang\" : msg.payload }\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":840,"y":600,"wires":[["5e643f2e1a99ebf5"]]},{"id":"fb1360ad61bd15b7","type":"ui_gauge","z":"d14665f497560d19","name":"电池电压","group":"2cdc47cd6915371c","order":4,"width":0,"height":0,"gtype":"gage","title":"电池电压","label":"units","format":"{{value}}","min":0,"max":"60","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","diff":false,"className":"","x":1120,"y":120,"wires":[]},{"id":"d835cebb31561b22","type":"ui_gauge","z":"d14665f497560d19","name":"充电电流","group":"2cdc47cd6915371c","order":5,"width":0,"height":0,"gtype":"gage","title":"充电电流","label":"units","format":"{{value}}","min":0,"max":"20","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","diff":false,"className":"","x":1120,"y":160,"wires":[]},{"id":"8f3aff510d3a0972","type":"ui_gauge","z":"d14665f497560d19","name":"内部温度","group":"2cdc47cd6915371c","order":8,"width":0,"height":0,"gtype":"gage","title":"内部温度","label":"units","format":"{{value}}","min":0,"max":"50","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","diff":false,"className":"","x":1120,"y":200,"wires":[]},{"id":"92cc4e0e402dbf2c","type":"ui_gauge","z":"d14665f497560d19","name":"日发电量","group":"2cdc47cd6915371c","order":10,"width":0,"height":0,"gtype":"gage","title":"日发电量","label":"units","format":"{{value}}","min":0,"max":"5","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","diff":false,"className":"","x":1120,"y":240,"wires":[]},{"id":"7898c37e05c56181","type":"ui_gauge","z":"d14665f497560d19","name":"总电量","group":"2cdc47cd6915371c","order":12,"width":0,"height":0,"gtype":"gage","title":"总电量","label":"units","format":"{{value}}","min":0,"max":"10000","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","diff":false,"className":"","x":1110,"y":280,"wires":[]},{"id":"234a6052c8284a33","type":"ui_chart","z":"d14665f497560d19","name":"电池电压","group":"2cdc47cd6915371c","order":3,"width":0,"height":0,"label":"电池电压","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":1260,"y":140,"wires":[[]]},{"id":"5b82654b2caf3cce","type":"ui_chart","z":"d14665f497560d19","name":"充电电流","group":"2cdc47cd6915371c","order":6,"width":0,"height":0,"label":"充电电流","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":1260,"y":180,"wires":[[]]},{"id":"550bf4ef3a82dcca","type":"ui_chart","z":"d14665f497560d19","name":"内部温度","group":"2cdc47cd6915371c","order":7,"width":0,"height":0,"label":"内部温度","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":1260,"y":220,"wires":[[]]},{"id":"45ce7fd8a930d73a","type":"ui_chart","z":"d14665f497560d19","name":"日发电量","group":"2cdc47cd6915371c","order":9,"width":0,"height":0,"label":"日发电量","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":1260,"y":260,"wires":[[]]},{"id":"7801cd953b436005","type":"ui_chart","z":"d14665f497560d19","name":"总电量","group":"2cdc47cd6915371c","order":11,"width":0,"height":0,"label":"总电量","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":1270,"y":300,"wires":[[]]},{"id":"fef8c4cbbbf475f8","type":"rbe","z":"d14665f497560d19","name":"","func":"narrowband","gap":"1","start":"","inout":"out","septopics":false,"property":"payload","topi":"topic","x":590,"y":220,"wires":[["4b70e3eddde66ad0","5714c4e4add6fdbf","7898c37e05c56181","7801cd953b436005"]]},{"id":"22023b3a42c7ab29","type":"rbe","z":"d14665f497560d19","name":"","func":"narrowband","gap":"150","start":"","inout":"out","septopics":false,"property":"payload","topi":"topic","x":590,"y":20,"wires":[["08c27ca36ab4a8f0","4e319e06fb193afe","f0366b94948ffda0","98345acc1a3f03c2"]]},{"id":"542d4a0cd3332f77","type":"rbe","z":"d14665f497560d19","name":"","func":"narrowband","gap":"10","start":"","inout":"out","septopics":false,"property":"payload","topi":"topic","x":590,"y":140,"wires":[["7f91e96abb6a64da","972fb9d629e035d0","8f3aff510d3a0972","550bf4ef3a82dcca"]]},{"id":"f8872c135074e180","type":"rbe","z":"d14665f497560d19","name":"","func":"narrowband","gap":"10","start":"","inout":"out","septopics":false,"property":"payload","topi":"topic","x":590,"y":180,"wires":[["c44b5a63098091b5","24eb22efb8d20919","92cc4e0e402dbf2c","45ce7fd8a930d73a"]]},{"id":"31d68d25b1711316","type":"rbe","z":"d14665f497560d19","name":"","func":"narrowband","gap":"10","start":"","inout":"out","septopics":false,"property":"payload","topi":"topic","x":590,"y":100,"wires":[["a479933d6ca7a835","f53fa1b057720870","d835cebb31561b22","5b82654b2caf3cce"]]},{"id":"2e56a49a1f146105","type":"rbe","z":"d14665f497560d19","name":"","func":"narrowband","gap":"10","start":"","inout":"out","septopics":false,"property":"payload","topi":"topic","x":590,"y":60,"wires":[["55bafdb7d99ba386","0d09d48106ccd2c9","fb1360ad61bd15b7","234a6052c8284a33"]]},{"id":"28be618f873f23c4","type":"function","z":"d14665f497560d19","name":"chongdiangonglv","func":"var a = parseInt('0x' + msg.payload.slice(8, 10).toString('hex'))\nvar b = parseInt('0x' + msg.payload.slice(10, 12).toString('hex'))\nvar c = a / 100 * b / 100\nmsg.payload = c.toFixed(2)\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":350,"y":280,"wires":[["d0dc5ee7be3e7961"]]},{"id":"d0dc5ee7be3e7961","type":"rbe","z":"d14665f497560d19","name":"","func":"narrowband","gap":"150","start":"","inout":"in","septopics":false,"property":"payload","topi":"topic","x":590,"y":260,"wires":[["d01c656e0996792e","6e5a2c0cd297c880"]]},{"id":"d01c656e0996792e","type":"function","z":"d14665f497560d19","name":"充电功率UI","func":"msg.topic = \"home/mppt/chongdiangonglv\"\nmsg.payload = {\"chongdiangonglv\":msg.payload}\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":850,"y":640,"wires":[["5e643f2e1a99ebf5"]]},{"id":"6e5a2c0cd297c880","type":"debug","z":"d14665f497560d19","name":"debug 9","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":850,"y":300,"wires":[]},{"id":"092c71e7ed7a7245","type":"function","z":"d14665f497560d19","name":"waibuwendu","func":"var a=parseInt('0x'+msg.payload.slice(16,18).toString('hex'))\nmsg.payload=a/10\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":350,"y":320,"wires":[["ca1c18b2948d0ca5","f862baf3cacb0193"]]},{"id":"ca1c18b2948d0ca5","type":"rbe","z":"d14665f497560d19","name":"","func":"narrowband","gap":"10","start":"","inout":"out","septopics":false,"property":"payload","topi":"topic","x":590,"y":300,"wires":[["471c0ad8e6d14158"]]},{"id":"471c0ad8e6d14158","type":"function","z":"d14665f497560d19","name":"外部温度UI","func":"msg.topic = \"home/mppt/waibuwendu\"\nmsg.payload = {\"waibuwendu\":msg.payload }\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":850,"y":680,"wires":[["5e643f2e1a99ebf5"]]},{"id":"f862baf3cacb0193","type":"debug","z":"d14665f497560d19","name":"debug 19","active":false,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":550,"y":420,"wires":[]},{"id":"2cdc47cd6915371c","type":"ui_group","name":"MPPT状态","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":"e60015d31fb88ff5","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]     把上面内容导到你的nodered里再结合你的通信协议更改吧
回复

使用道具 举报

3

主题

22

帖子

132

积分

注册会员

Rank: 2

积分
132
金钱
110
HASS币
0
 楼主| 发表于 2024-4-16 13:31:59 | 显示全部楼层
chenxiaowei 发表于 2024-4-16 13:30
nodered 的json代码
[{"id":"d14665f497560d19","type":"tab","label":"光伏系统接入流程","disabled":fa ...

configuration.yaml里添加的代码
mqtt:
  sensor:
    - name: "pvdianya"
      device_class: energy
      state_topic: "home/mppt/pvdianya"
      unit_of_measurement: "V"
      value_template: "{{ value_json.pvdianya }}"
   
    - name: "dianchidianya"
      device_class: energy
      state_topic: "home/mppt/dianchidinaya"
      state_class: total_increasing
      unit_of_measurement: "V"
      value_template: "{{ value_json.dianchidinaya }}"
   
    - name: "chongdiandianliu"
      device_class: energy
      state_topic: "home/mppt/chongdiandianliu"
      unit_of_measurement: "A"
      value_template: "{{ value_json.chongdiandianliu }}"
  
    - name: "neibuwendu"
      device_class: energy
      state_topic: "home/mppt/neibuwendu"
      unit_of_measurement: "℃"
      value_template: "{{ value_json.neibuwendu }}"
      
    - name: "waibuwendu"
      device_class: energy
      state_topic: "home/mppt/waibuwendu"
      unit_of_measurement: "℃"
      value_template: "{{ value_json.waibuwendu }}"
  
    - name: "rifadianliang"
      device_class: energy
      state_topic: "home/mppt/rifadianliang"
      state_class: total_increasing
      unit_of_measurement: "kWh"
      value_template: "{{ value_json.rifadianliang }}"
  
    - name: "zongdianliang"
      device_class: energy
      state_topic: "home/mppt/zongdianliang"
      unit_of_measurement: "kWh"
      value_template: "{{ value_json.zongdianliang }}"
      
    - name: "chongdiangonglv"
      device_class: energy
      state_topic: "home/mppt/chongdiangonglv"
      unit_of_measurement: "W"
      value_template: "{{ value_json.chongdiangonglv }}"
      
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-25 07:23 , Processed in 0.107763 second(s), 33 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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