shaonianzhentan / node-red-contrib-ha-mqtt

在HomeAssistant中生成MQTT实体
https://github.com/shaonianzhentan/node-red-contrib-ha-mqtt
MIT License
37 stars 19 forks source link

Hang of my mqtt-server #21

Open FreekBos opened 2 years ago

FreekBos commented 2 years ago

Hi, Thanks for your nodes: the principle is brilliant! Super! When I try to implement this, my (mosquito centos7) mqtt server hangs. Any idea or documentation to prevent it? Thanks ever so much

shaonianzhentan commented 2 years ago

Sorry, I don't know why This is simple example. Hope to help you https://github.com/shaonianzhentan/node-red-contrib-ha-mqtt/blob/main/examples/switch.json

FreekBos commented 1 year ago

Hi, thanks and I’ve done a couple of things: upgraded my entire infrastructure.

I ran your example too.

I have a number of YAML NodeRed->HomeAssistant sensor / switch (HA.txt).

Using mqtt to store values and using home assistant mqtt to read the value.

Here is 1 example:


- name: "house_h13_motion"

  state_topic: "h13/home/house/motion/house"

  device_class: motion

  payload_on: "true"

  payload_off: "false"

  qos: 1

My NodeRed example is included for you to see…

Again, your work is super; it just needs more documentation for the “less knowlegdale” like myself 😉

Hope you can advise,

F

Van: Monkey • D • Code @.> Verzonden: dinsdag 5 juli 2022 04:52 Aan: shaonianzhentan/node-red-contrib-ha-mqtt @.> CC: Freek Bos @.>; Author @.> Onderwerp: Re: [shaonianzhentan/node-red-contrib-ha-mqtt] Hang of my mqtt-server (Issue #21)

Sorry, I don't know why This is simple example. Hope to help you https://github.com/shaonianzhentan/node-red-contrib-ha-mqtt/blob/main/examples/switch.json https://github.com/shaonianzhentan/node-red-contrib-ha-mqtt/blob/main/examples/switch.json

— Reply to this email directly, https://github.com/shaonianzhentan/node-red-contrib-ha-mqtt/issues/21#issuecomment-1174546256 view it on GitHub, or https://github.com/notifications/unsubscribe-auth/AIEEOFINTYMAO5LWPETXXCDVSOPLZANCNFSM52SWU46Q unsubscribe. You are receiving this because you authored the thread. https://dl.efa-project.org/static/1x1spacer.gif Message ID: < @.> @.>

[ { @.": " http://schema.org http://schema.org", @.": "EmailMessage", "potentialAction": { @.": "ViewAction", "target": " https://github.com/shaonianzhentan/node-red-contrib-ha-mqtt/issues/21#issuecomment-1174546256 https://github.com/shaonianzhentan/node-red-contrib-ha-mqtt/issues/21#issuecomment-1174546256", "url": " https://github.com/shaonianzhentan/node-red-contrib-ha-mqtt/issues/21#issuecomment-1174546256 https://github.com/shaonianzhentan/node-red-contrib-ha-mqtt/issues/21#issuecomment-1174546256", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { @.": "Organization", "name": "GitHub", "url": " https://github.com https://github.com" } } ]

[ { "id": "5240e464445a28b3", "type": "tab", "label": "Switch", "disabled": false, "info": "", "env": [] }, { "id": "4324bb84fbc79040", "type": "ha-mqtt-switch", "z": "5240e464445a28b3", "server": "ff3d0b36.271a28", "device": "29140acbaa25bac8", "name": "开关", "config": "", "x": 390, "y": 200, "wires": [ [ "422e5af63686dfbf" ] ] }, { "id": "1955208157ee4feb", "type": "inject", "z": "5240e464445a28b3", "name": "", "props": [ { "p": "payload" }, { "p": "attributes", "v": "{\"key\":\"value\"}", "vt": "json" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "ON", "payloadType": "str", "x": 230, "y": 400, "wires": [ [ "4324bb84fbc79040", "f77da069018c033f" ] ] }, { "id": "422e5af63686dfbf", "type": "debug", "z": "5240e464445a28b3", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 570, "y": 200, "wires": [] }, { "id": "f77da069018c033f", "type": "ha-mqtt-binary_sensor", "z": "5240e464445a28b3", "server": "ff3d0b36.271a28", "device": "bc0fb80883e96609", "name": "h13/home/house/day-night/daylight", "config": "", "x": 660, "y": 420, "wires": [] }, { "id": "cd3233b3a836382c", "type": "inject", "z": "5240e464445a28b3", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 240, "y": 460, "wires": [ [ "f77da069018c033f" ] ] }, { "id": "3548e4444e8f114c", "type": "inject", "z": "5240e464445a28b3", "name": "sunrise", "props": [ { "p": "payload.sunevent", "v": "sunrise", "vt": "str" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payloadType": "str", "x": 210, "y": 600, "wires": [ [ "6b0c0430b8912b88" ] ] }, { "id": "dd0cea0be20e66e1", "type": "inject", "z": "5240e464445a28b3", "name": "sunset", "props": [ { "p": "payload.sunevent", "v": "sunset", "vt": "str" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payloadType": "str", "x": 210, "y": 680, "wires": [ [ "6b0c0430b8912b88" ] ] }, { "id": "69ff3b55da885875", "type": "sun events", "z": "5240e464445a28b3", "testmode": false, "verbose": false, "topic": "", "name": "Sunrise / Sunset", "x": 240, "y": 640, "wires": [ [ "6b0c0430b8912b88", "430aea8f16b86749" ] ], "info": "Hullandstraat 13 =\n latitude: 52.3147821\n longitude: 5.9728807" }, { "id": "b5965f517383da6d", "type": "change", "z": "5240e464445a28b3", "name": "sunset->true", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "true", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 610, "y": 640, "wires": [ [ "3cca0cda748fc006", "7d69d4df71765377" ] ] }, { "id": "6b0c0430b8912b88", "type": "switch", "z": "5240e464445a28b3", "name": "sunrise / sunset", "property": "payload.sunevent", "propertyType": "msg", "rules": [ { "t": "eq", "v": "sunrise", "vt": "str" }, { "t": "eq", "v": "sunset", "vt": "str" }, { "t": "else" } ], "checkall": "false", "repair": false, "outputs": 3, "x": 600, "y": 600, "wires": [ [ "d1e170a918c68aab" ], [ "b5965f517383da6d" ], [] ] }, { "id": "163184e6f4796981", "type": "inject", "z": "5240e464445a28b3", "name": "Hullandstraat 13", "props": [ { "p": "payload.lat", "v": "52.31500949537901", "vt": "num" }, { "p": "payload.lng", "v": "5.972815767944771", "vt": "num" } ], "repeat": "86400", "crontab": "", "once": true, "onceDelay": "1", "topic": "", "x": 250, "y": 560, "wires": [ [ "69ff3b55da885875" ] ] }, { "id": "d1e170a918c68aab", "type": "change", "z": "5240e464445a28b3", "name": "sunrise->false", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "false", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 600, "y": 560, "wires": [ [ "7d69d4df71765377", "3cca0cda748fc006" ] ] }, { "id": "7d69d4df71765377", "type": "trigger", "z": "5240e464445a28b3", "name": "", "op1": "", "op2": "false", "op1type": "nul", "op2type": "str", "duration": "4", "extend": false, "overrideDelay": false, "units": "min", "reset": "true", "bytopic": "all", "topic": "topic", "outputs": 1, "x": 970, "y": 560, "wires": [ [ "d154bead59f59a78" ] ] }, { "id": "3cca0cda748fc006", "type": "trigger", "z": "5240e464445a28b3", "name": "", "op1": "", "op2": "true", "op1type": "nul", "op2type": "str", "duration": "10", "extend": false, "overrideDelay": false, "units": "min", "reset": "false", "bytopic": "all", "topic": "topic", "outputs": 1, "x": 970, "y": 640, "wires": [ [ "d154bead59f59a78" ] ] }, { "id": "d154bead59f59a78", "type": "change", "z": "5240e464445a28b3", "name": "house/day-night/dawn", "rules": [ { "t": "set", "p": "topic", "pt": "msg", "to": "h13/home/house/day-night/dawn", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1320, "y": 580, "wires": [ [ "834e986651dee312" ] ] }, { "id": "8e02bcf6a8fadda7", "type": "mqtt out", "z": "5240e464445a28b3", "name": "MQTT Out (mqtt.bos.tc)", "topic": "", "qos": "", "retain": "", "respTopic": "", "contentType": "", "userProps": "", "correl": "", "expiry": "", "broker": "ff3d0b36.271a28", "x": 1850, "y": 560, "wires": [] }, { "id": "834e986651dee312", "type": "change", "z": "5240e464445a28b3", "name": "qos + retain", "rules": [ { "t": "set", "p": "qos", "pt": "msg", "to": "0", "tot": "str" }, { "t": "set", "p": "retain", "pt": "msg", "to": "true", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1630, "y": 560, "wires": [ [ "8e02bcf6a8fadda7" ] ] }, { "id": "430aea8f16b86749", "type": "change", "z": "5240e464445a28b3", "name": "house/day-night/state", "rules": [ { "t": "set", "p": "topic", "pt": "msg", "to": "h13/home/house/day-night/state", "tot": "str" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 1320, "y": 680, "wires": [ [ "834e986651dee312" ] ] }, { "id": "920c688e88158ff8", "type": "comment", "z": "5240e464445a28b3", "name": "sunrise=false / sunset=true", "info": "", "x": 290, "y": 520, "wires": [] }, { "id": "ff3d0b36.271a28", "type": "mqtt-broker", "name": "h13-mqtt-acc", "broker": "h13-mqtt-acc.bos.tc", "port": "1883", "clientid": "nr-acc-mqtt-in", "autoConnect": true, "usetls": false, "compatmode": false, "protocolVersion": "3", "keepalive": "60", "cleansession": false, "birthTopic": "", "birthQos": "0", "birthPayload": "", "birthMsg": {}, "closeTopic": "", "closeQos": "0", "closePayload": "", "closeMsg": {}, "willTopic": "", "willQos": "0", "willPayload": "", "willMsg": {}, "userProps": "", "sessionExpiry": "" }, { "id": "29140acbaa25bac8", "type": "ha-mqtt-device", "name": "测试设备", "config": "" }, { "id": "bc0fb80883e96609", "type": "ha-mqtt-device", "name": "h13/home/house/day-night/dawn", "config": "" } ] mqtt: broker: !secret mqtt_broker port: !secret mqtt_port username: !secret mqtt_username password: !secret mqtt_password discovery: true binary_sensor: