I'm trying to connect a switch in node-red, which I connected without problems via zigbee2mqtt. The output I get is signle/double/long.
unless my HA went wrong, I had it like this - a red square. But it doesn't work that way for me now.
I'm trying to set it up according to this video https://www.youtube.com/watch?v=AjF80G9abxE which seems to be pretty easy, but it still doesn't work. I don't get any message in debug4 when pressing
It would be much better to just post what you have done rather than point to a ytube video. Select all the nodes of the flow so they are highlighted. Go to the hamburger menu on the top right and choose export.
Copy the code from the popup and post it here using this guide.
ok
this is my old, worked in the past
[
{
"id": "41e8c18ff3bfbf18",
"type": "mqtt in",
"z": "8d97a1cabd5421a7",
"g": "a878beb33810d03d",
"name": "",
"topic": "zigbee2mqtt/WC_vypinac/action",
"qos": "2",
"datatype": "auto-detect",
"broker": "b32114bf2fb8fc4a",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 170,
"y": 500,
"wires": [
[
"4cfc4ff5582e2bb0"
]
]
},
{
"id": "4cfc4ff5582e2bb0",
"type": "switch",
"z": "8d97a1cabd5421a7",
"g": "a878beb33810d03d",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "single",
"vt": "str"
},
{
"t": "eq",
"v": "double",
"vt": "str"
},
{
"t": "eq",
"v": "long",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 3,
"x": 390,
"y": 460,
"wires": [
[
"d0acfe6646c4cd1a"
],
[
"e933fbdbc851c3c9"
],
[
"bc07d66be1f96899"
]
]
},
{
"id": "e933fbdbc851c3c9",
"type": "api-call-service",
"z": "8d97a1cabd5421a7",
"g": "a878beb33810d03d",
"name": "sv on 100%",
"server": "7d42f0ac.4e8ab",
"version": 7,
"debugenabled": false,
"action": "light.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.0x54ef441000b03c2b"
],
"labelId": [],
"data": "{\"brightness_pct\":\"100\"}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "light",
"service": "turn_on",
"x": 550,
"y": 440,
"wires": [
[]
]
},
{
"id": "bc07d66be1f96899",
"type": "api-call-service",
"z": "8d97a1cabd5421a7",
"g": "a878beb33810d03d",
"name": "sv on 5%",
"server": "7d42f0ac.4e8ab",
"version": 7,
"debugenabled": false,
"action": "light.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.0x54ef441000b03c2b"
],
"labelId": [],
"data": "{\"brightness_pct\":\"5\"}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "light",
"service": "turn_on",
"x": 540,
"y": 480,
"wires": [
[]
]
},
{
"id": "d0acfe6646c4cd1a",
"type": "api-call-service",
"z": "8d97a1cabd5421a7",
"g": "a878beb33810d03d",
"name": "ventilátor on/off",
"server": "7d42f0ac.4e8ab",
"version": 7,
"debugenabled": false,
"action": "switch.toggle",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"switch.0x54ef441000a6a919"
],
"labelId": [],
"data": "",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "switch",
"service": "toggle",
"x": 540,
"y": 600,
"wires": [
[]
]
},
{
"id": "b32114bf2fb8fc4a",
"type": "mqtt-broker",
"name": "",
"broker": "172.30.33.0/24",
"port": "",
"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": "7d42f0ac.4e8ab",
"type": "server",
"name": "Home Assistant",
"addon": true,
"rejectUnauthorizedCerts": true,
"ha_boolean": "",
"connectionDelay": false,
"cacheJson": false,
"heartbeat": false,
"heartbeatInterval": "",
"statusSeparator": "",
"enableGlobalContextStore": false
},
{
"id": "45e698cfa59052b9",
"type": "global-config",
"env": [],
"modules": {
"node-red-contrib-home-assistant-websocket": "0.80.3"
}
}
]
this is from YT tutorial
[
{
"id": "d0acfe6646c4cd1a",
"type": "api-call-service",
"z": "8d97a1cabd5421a7",
"g": "a878beb33810d03d",
"name": "ventilátor on/off",
"server": "7d42f0ac.4e8ab",
"version": 7,
"debugenabled": false,
"action": "switch.toggle",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"switch.0x54ef441000a6a919"
],
"labelId": [],
"data": "",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "switch",
"service": "toggle",
"x": 540,
"y": 600,
"wires": [
[]
]
},
{
"id": "0212102e081db781",
"type": "server-state-changed",
"z": "8d97a1cabd5421a7",
"g": "a878beb33810d03d",
"name": "vypinac",
"server": "7d42f0ac.4e8ab",
"version": 6,
"outputs": 1,
"exposeAsEntityConfig": "",
"entities": {
"entity": [
"update.0x08ddebfffea36724"
],
"substring": [],
"regex": []
},
"outputInitially": false,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": false,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "string",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "",
"valueType": "triggerId"
}
],
"x": 90,
"y": 400,
"wires": [
[
"4cfc4ff5582e2bb0",
"39f83f5c23795e63"
]
]
},
{
"id": "4cfc4ff5582e2bb0",
"type": "switch",
"z": "8d97a1cabd5421a7",
"g": "a878beb33810d03d",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "single",
"vt": "str"
},
{
"t": "eq",
"v": "double",
"vt": "str"
},
{
"t": "eq",
"v": "long",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 3,
"x": 390,
"y": 460,
"wires": [
[
"d0acfe6646c4cd1a"
],
[
"e933fbdbc851c3c9"
],
[
"bc07d66be1f96899"
]
]
},
{
"id": "e933fbdbc851c3c9",
"type": "api-call-service",
"z": "8d97a1cabd5421a7",
"g": "a878beb33810d03d",
"name": "sv on 100%",
"server": "7d42f0ac.4e8ab",
"version": 7,
"debugenabled": false,
"action": "light.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.0x54ef441000b03c2b"
],
"labelId": [],
"data": "{\"brightness_pct\":\"100\"}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "light",
"service": "turn_on",
"x": 550,
"y": 440,
"wires": [
[]
]
},
{
"id": "bc07d66be1f96899",
"type": "api-call-service",
"z": "8d97a1cabd5421a7",
"g": "a878beb33810d03d",
"name": "sv on 5%",
"server": "7d42f0ac.4e8ab",
"version": 7,
"debugenabled": false,
"action": "light.turn_on",
"floorId": [],
"areaId": [],
"deviceId": [],
"entityId": [
"light.0x54ef441000b03c2b"
],
"labelId": [],
"data": "{\"brightness_pct\":\"5\"}",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"blockInputOverrides": true,
"domain": "light",
"service": "turn_on",
"x": 540,
"y": 480,
"wires": [
[]
]
},
{
"id": "7d42f0ac.4e8ab",
"type": "server",
"name": "Home Assistant",
"addon": true,
"rejectUnauthorizedCerts": true,
"ha_boolean": "",
"connectionDelay": false,
"cacheJson": false,
"heartbeat": false,
"heartbeatInterval": "",
"statusSeparator": "",
"enableGlobalContextStore": false
},
{
"id": "5907218dbab849c7",
"type": "global-config",
"env": [],
"modules": {
"node-red-contrib-home-assistant-websocket": "0.80.3"
}
}
]
No reports. Nothing
You'll need to look at z2m to find out why there is no message. Maybe the topic changed?
