david-kasparov / node-red-contrib-pcf8574-cluster

3 stars 2 forks source link

Set Pin Value #2

Open kaypohl opened 6 years ago

kaypohl commented 6 years ago

Hi David,

me again :-)

Short question: Can i set the Pin Value over Cluster-Out with msg.topic? At the moment when I inject a timestamp the pin value toggles.

Greetings Kay

Christian-Me commented 6 years ago

Same here:

[ { "id": "fab50ad6.1de3c8", "type": "cluster-out", "z": "b0a0718b.9e127", "cluster": "1c750a5.143edf6", "name": "Pin3", "pin": "3", "inverted": false, "initialValue": false, "x": 570, "y": 2180, "wires": [] }, { "id": "285f93d8.57afdc", "type": "inject", "z": "b0a0718b.9e127", "name": "", "topic": "Send 1", "payload": "1", "payloadType": "num", "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "x": 380, "y": 2180, "wires": [ [ "fab50ad6.1de3c8" ] ] }, { "id": "1c750a5.143edf6", "type": "cluster-configurator", "z": "", "addresses": " { \"addresses\": [32] }", "initialStates": "{ \"initial_states\":[false,false,false,false,false,false,false,false]}", "interrupts": "{ \"interrupts\": [ ] }" } ]

kaypohl commented 6 years ago

Thanks for your answer. There is just one thing i don't understand.

If I switch Pin1 for example to High, all other Pins lose their state. I think that is a normal behaviour of the pcf8574. So I have to read first the sate of all pins and switch all Pins regarding their state, right?

Kay

kaypohl commented 6 years ago

Same here:

[ { "id": "fab50ad6.1de3c8", "type": "cluster-out", "z": "b0a0718b.9e127", "cluster": "1c750a5.143edf6", "name": "Pin3", "pin": "3", "inverted": false, "initialValue": false, "x": 570, "y": 2180, "wires": [] }, { "id": "285f93d8.57afdc", "type": "inject", "z": "b0a0718b.9e127", "name": "", "topic": "Send 1", "payload": "1", "payloadType": "num", "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "x": 380, "y": 2180, "wires": [ [ "fab50ad6.1de3c8" ] ] }, { "id": "1c750a5.143edf6", "type": "cluster-configurator", "z": "", "addresses": " { \"addresses\": [32] }", "initialStates": "{ \"initial_states\":[false,false,false,false,false,false,false,false]}", "interrupts": "{ \"interrupts\": [ ] }" } ]

No that doesn't work. It toggles even if i just send "1" as string.