First of all, thank you again for this great set of node!!
Describe the bug
The security system node behaves bad if you set the characteristics.
If you set the characteristics (see "to reproduce"), the node gives an error in the node-red log:
[BridgeAccessi F1D3@Antifurto@Antifurto@Security System Current State] characteristic value 0 is not contained in valid values array
[BridgeAccessi F1D3@Antifurto@Antifurto@Security System Target State] characteristic value 0 is not contained in valid values array
The bad thing, is that the node outputs a SecuritySystemTargetState = 1 (ARM AWAY) to the flow, arming the security system,
To Reproduce
Put a security system node ti the flow and set these characteristics in the config window.
{
"SecuritySystemCurrentState": {
"validValues": [
1,
2,
3,
4
]
},
"SecuritySystemTargetState": {
"validValues": [
1,
2,
3,
4
]
}
}
Expected behavior
No error on noce-red log and no output SecuritySystemTargetState = 1
Thank you!!
Some comments:
Security system TargetState can't be 4. That's "ALARM" - current state can be 4.
State 0 is "armed home" which is annoyingly the initial state of the security system.
What if you use these char props?
{
"SecuritySystemCurrentState": {
"minValue": 1,
"validValues": [
1,
2,
3,
4
]
},
"SecuritySystemTargetState": {
"minValue": 1,
"validValues": [
1,
2,
3
]
}
}
The goal would be to get the HomeKit (hap-nodejs?) system to stop emitting 0 state when it starts up... I've not tested this, let me know what happens and we'll figure out what should be the next test.
Any reason you don't want the "Home" state on your alarm?
Hi
Thanks for the quick feedback.
I haven’t the “home” state in my security system, so i don’t want to see it in the options.
Yes you’re right, the 4 is the alarm.
Some versions ago, this has never caused such a problem. Today i’ve updated the hk node and this issue appeared.
;-)
Using my JSON - it works properly but I can confirm a similar error in my log:
Apr 04 17:52:42 raspberrypi Node-RED[385]: [Demo 1 6402@Security no Home@Security no Home@Security System Current State] characteristic was supplied illegal value: number 0 exceeded minimum of 1
Apr 04 17:52:42 raspberrypi Node-RED[385]: [Demo 1 6402@Security no Home@Security no Home@Security System Target State] characteristic was supplied illegal value: number 0 exceeded minimum of 1
That being said... the device works as expected, goes to "Away" as default startup value (current state = 1) and there is no "home" option, as expected.
@Shaquu - any idea why this error is now popping up? I don't know if it's an _error_ so much as a _warning_ since everything continues working fine for me.
@Supergiovane - is your security system working properly? I just went through some basic tests and didn't get any logs in nodered after the initial deploy and add to home app... Everything worked as it does with the security system I use in my setup.
Hi crxporter
Previously, the node has never sent the “away” payload after restart. Now it sends that payload so i need to handle this behavior.
Other than that, it works as usual.
By removing the characteristics json, leaving the textfield blank, the node doesn’t logs any error and it doesn’t emit the “away” payload anymore.
this error is repeated with TargetTemperature
node-red | [kubik3 C91D@lessar@lessar@Target Temperature] characteristic was supplied illegal value: number 10 exceeded minimum of 17
on
"TargetTemperature": {
"minValue": 17,
"maxValue": 30,
"minStep": 1
}
To answer questions from @crxporter
Error is here since HapNodeJS guys are adding more and more validations.
Regarding error. Probably it means HomeKit is trying to set 0 (by default) but it is not set due to ranges so it stays with previous value.
@twocolors Same about you.
10 is not in range 17-30 so the error appears :)
Please check if you are not sending 10 in NodeRED or else.
"Error" could be a strong word, perhaps it's just a "warning" or simply "information"?
Has anyone had any broken functionality from this?
@Shaquu or else , some magic ...

{
"Name": "Кондиционер",
"TargetHeatingCoolingState": {
"validValues": [
0,
1,
2,
3
]
},
"CurrentHeatingCoolingState": {
"validValues": [
0,
1,
2,
3
]
},
"TargetTemperature": {
"minValue": 17,
"maxValue": 30,
"minStep": 1
}
}
log
node-red | Starting to advertise 'kubik3 C91D' using ciao backend!
node-red | [kubik3 C91D@lessar11@lessar11@Target Temperature] characteristic was supplied illegal value: number 10 exceeded minimum of 17
The latest update seems to have solved the issue.