Bonjour,
Je débute sur node-red, j’ai lu plusieurs de vos posts, ce qui m’a permis de démarrer un premier flow, merci à vous.
Avant de me lancer dans la lecture de posts plus aboutis, voici mon souci. Le statut de mon volet ne change pas entre chaque exécution.???
Voici ce que j’ai fait, si vous pouviez me dire où j’ai une erreur.
la configuration du switch:
Le state ne change pas donc je passe toujours dans open. Le volet s’ouvre ou se ferme à chaque exécution mais sans changer d’état. Je ne sais pas pourquoi.
Mon flow en JSON si plus simple
[
{
"id": "0690c21701f8a1a7",
"type": "inject",
"z": "41f6b287083c2ada",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 120,
"y": 160,
"wires": [
[
"533e4727957ae2e9"
]
]
},
{
"id": "533e4727957ae2e9",
"type": "api-current-state",
"z": "41f6b287083c2ada",
"name": "",
"server": "8ba7aec4.1022e",
"version": 3,
"outputs": 1,
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "cover.commutateur_de_rideau_5_curtain",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 430,
"y": 60,
"wires": [
[
"67f5e5d499af69e8",
"b9cc2f0448265ebd"
]
]
},
{
"id": "860d4ff9e62c4993",
"type": "debug",
"z": "41f6b287083c2ada",
"name": "JSON",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 870,
"y": 140,
"wires": []
},
{
"id": "becaa97ac4c4a19e",
"type": "api-call-service",
"z": "41f6b287083c2ada",
"name": "",
"server": "8ba7aec4.1022e",
"version": 5,
"debugenabled": true,
"domain": "cover",
"service": "open_cover",
"areaId": [],
"deviceId": [
"c39d8e65a25cc96e65bd524011ba935a"
],
"entityId": [
"cover.commutateur_de_rideau_5_curtain"
],
"data": "",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"x": 1090,
"y": 240,
"wires": [
[]
]
},
{
"id": "67f5e5d499af69e8",
"type": "json",
"z": "41f6b287083c2ada",
"name": "",
"property": "data.entity_id",
"action": "str",
"pretty": false,
"x": 470,
"y": 140,
"wires": [
[
"90885d949b1bb328",
"860d4ff9e62c4993",
"36dde56eeb6e146b"
]
]
},
{
"id": "88c3911f830af95c",
"type": "debug",
"z": "41f6b287083c2ada",
"name": "close",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "data.state",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1070,
"y": 200,
"wires": []
},
{
"id": "90885d949b1bb328",
"type": "switch",
"z": "41f6b287083c2ada",
"name": "",
"property": "data.state",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "close",
"vt": "str"
},
{
"t": "eq",
"v": "open",
"vt": "str"
}
],
"checkall": "false",
"repair": false,
"outputs": 2,
"x": 730,
"y": 200,
"wires": [
[
"88c3911f830af95c",
"becaa97ac4c4a19e"
],
[
"8e3a709b6e7523c8",
"299e6ad8c4d39aeb"
]
]
},
{
"id": "8e3a709b6e7523c8",
"type": "debug",
"z": "41f6b287083c2ada",
"name": "Open",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "data.state",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1070,
"y": 320,
"wires": []
},
{
"id": "299e6ad8c4d39aeb",
"type": "api-call-service",
"z": "41f6b287083c2ada",
"name": "",
"server": "8ba7aec4.1022e",
"version": 5,
"debugenabled": true,
"domain": "cover",
"service": "close_cover",
"areaId": [],
"deviceId": [
"c39d8e65a25cc96e65bd524011ba935a"
],
"entityId": [
"cover.commutateur_de_rideau_5_curtain"
],
"data": "",
"dataType": "json",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"x": 1090,
"y": 360,
"wires": [
[]
]
},
{
"id": "36dde56eeb6e146b",
"type": "debug",
"z": "41f6b287083c2ada",
"name": "cover.state",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "data.state",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 630,
"y": 320,
"wires": []
},
{
"id": "b9cc2f0448265ebd",
"type": "debug",
"z": "41f6b287083c2ada",
"name": "debug 7",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 820,
"y": 60,
"wires": []
},
{
"id": "8ba7aec4.1022e",
"type": "server",
"name": "Home Assistant",
"version": 5,
"addon": true,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": true,
"cacheJson": true,
"heartbeat": false,
"heartbeatInterval": 30,
"areaSelector": "friendlyName",
"deviceSelector": "friendlyName",
"entitySelector": "friendlyName",
"statusSeparator": "at: ",
"statusYear": "hidden",
"statusMonth": "short",
"statusDay": "numeric",
"statusHourCycle": "h23",
"statusTimeFormat": "h:m",
"enableGlobalContextStore": true
}
]
Merci pour votre aide