Hi,
I’m working on a z-wave servo actuator device and it’s integration with openhab2 (using the ZUNO which is similar to a arduino with integrated z-wave).
For the actuator I’m using one multilevel channel:
ZUNO_SETUP_CHANNELS(ZUNO_SWITCH_MULTILEVEL(getter, setter));
Additional information under: http://z-uno.z-wave.me/Reference/ZUNO_SWITCH_MULTILEVEL/
The device is discovered by the auto discovery as node28 and I was able to add it. Here are the logs:
2017-12-31 10:43:21.771 [home.event.InboxAddedEvent] - Discovery Result with UID 'zwave:device:ddd3b615:node28' has been added.
2017-12-31 10:44:47.758 [me.event.InboxRemovedEvent] - Discovery Result with UID 'zwave:device:ddd3b615:node28' has been removed.
2017-12-31 10:44:47.760 [hingStatusInfoChangedEvent] - 'zwave:device:ddd3b615:node28' changed from UNINITIALIZED to INITIALIZING
2017-12-31 10:44:47.761 [hingStatusInfoChangedEvent] - 'zwave:device:ddd3b615:node28' changed from INITIALIZING to OFFLINE (BRIDGE_OFFLINE): Controller is offline
2017-12-31 10:44:47.761 [hingStatusInfoChangedEvent] - 'zwave:device:ddd3b615:node28' changed from OFFLINE (BRIDGE_OFFLINE): Controller is offline to ONLINE
2017-12-31 10:44:47.768 [me.event.ThingUpdatedEvent] - Thing 'zwave:device:ddd3b615:node28' has been updated.
2017-12-31 10:44:47.772 [me.event.ThingUpdatedEvent] - Thing 'zwave:device:ddd3b615:node28' has been updated.
2017-12-31 10:44:47.776 [me.event.ThingUpdatedEvent] - Thing 'zwave:device:ddd3b615:node28' has been updated.
It is being shown as “Unknown Device” as it’s not in the Z-Wave database (which I understand is hard coded in the binding). And most likely here is the problem.
I have created an item file for it:
Dimmer boiler_servo "Boiler Servo" { zwave="28:command=SWITCH_MULTILEVEL" }
And added it in the site map file, but it is not being shown:
Default item=boiler_servo
My target is to be able to control the actuator from the site map which is currently not possible. What needs to be done?
I assume the issue is being shown as “unknown device” and needs to be added to the database. Would this be possible with a file, without having to recompile the z-wave binding?
Beside this, I’m wondering why my definition in the site map is not being shown at all?
Here is the full arduino code:
/*
* That is a simple servo test. It just drives a single servo
*/
#include <ZUNO_SERVO.h>
// For some cases use UART (Serial0/Serial1)
// It's a most comfortable way for debugging
// By default we use built-in USB CDC (Serial)
#define MY_SERIAL Serial
// Connect servo PWM to Z-Uno digital pin 12
ServoController servo(12);
// variable to store current dimmer value
byte lastSetDimmer;
// next macro sets up the Z-Uno channels
// in this example we set up 1 switch multilevel channel
// you can read more on http://z-uno.z-wave.me/Reference/ZUNO_SWITCH_MULTILEVEL/
ZUNO_SETUP_CHANNELS(ZUNO_SWITCH_MULTILEVEL(getter, setter));
ZUNO_SETUP_SLEEPING_MODE(ZUNO_SLEEPING_MODE_ALWAYS_AWAKE);
ZUNO_SETUP_DEBUG_MODE(DEBUG_ON);
void setup() {
servo.begin();
MY_SERIAL.begin(115200);
MY_SERIAL.println("Starting...");
}
void setter(byte value) {
byte tempVariable;
// value is a variable, holding a "new value"
// which came from the controller or other Z-Wave device
if (value > 99) {
// by Z-Wave specification, this value can't be more then 99
value = 99;
}
// but the Servo angle scale ranges from 0 to 180
// we need to prepare our "value" for this new scale
tempVariable = ((word)value)*180/99;
// now we set the Servo position
servo.setValue(tempVariable);
// let's save our value for the situation, when the controller will ask us about it
lastSetDimmer = value;
}
// getter function is called once the controller
// or other device in the network asks Z-Uno about
// it's current level
byte getter(void) {
// return previously saved (in getter()) value
return lastSetDimmer;
}
void loop() {
MY_SERIAL.print("millis:");
MY_SERIAL.println(millis());
MY_SERIAL.print("current value:");
MY_SERIAL.println(lastSetDimmer);
delay(1000);
}
Any help is greatly appreciated.