When I add to create my own dummy devices to main.js I get the following error:
Type: core
Timestamp: 9/12/14-09:27
Message:
Can not create vDev based on 6-0-37: TypeError: Cannot read property 'data' of undefined
Code added:
vDev = controller.devices.get("DummyDevice_5");
vDev.on("change:metrics:level", function (vDev) {
var level = vDev.get("metrics:level");
setPortState(1, level);
});
When I look into the web UI the the deviceid= "DummyDevice_5"
What do I need to change?
[v2.0.0] Solved - error creating own deivces
[v2.0.0] Solved - error creating own deivces
Last edited by billyboy on 10 Dec 2014 09:53, edited 1 time in total.
Re: [v2.0.0] error creating own deivces
I don't think these are related. The error is about some Z-Wave device, while the Dummy should work independently.
Some suggestions:
1) do not add things in main.js, use Load Custom Code module instead.
2) Are you sure DummyDevice_5 already exists when this line is executed? May be it will return null?
3) There is special module for your task: Code Device
Some suggestions:
1) do not add things in main.js, use Load Custom Code module instead.
2) Are you sure DummyDevice_5 already exists when this line is executed? May be it will return null?
3) There is special module for your task: Code Device
Re: [v2.0.0] error creating own deivces
Whow, yes I found it, that makes custimize things a lot easier!
Great release, Thanks a lot!
Great release, Thanks a lot!
Re: [v2.0.0] error creating own deivces
One small question, where should I put my custum functions? in main.js?
Re: [v2.0.0] error creating own deivces
In Load Custom Code module. In 99.99999% cases you never need to alter Z-Way Home Automation JS code at all
Re: [v2.0.0] error creating own deivces
Yes it worked! Thank you.