Custom Widget
Custom Widget
I'm trying to create a very simple custom module (like Dummy Device) that executes a configurable bash script. The returned value should be presented in a very simple widget. I've read How to create a widget, but it seem to be very outdated - paths are wrong, I can't find the "registerWidgetClass" when grepping the code etc. Is there any updated info on creating a widget?
Re: Custom Widget
Are you aware of this: http://developer.z-wave.me/?uri=help ? It is the latest documentation.
I started at the time with the Local Weather module, which is relatively simple.
I started at the time with the Local Weather module, which is relatively simple.
Re: Custom Widget
yes, I have created my own modules which I can trigger so that is no problem, but in this case I want the module to show some info in addition, i.e. the result of running a bash script. For example in the same way a sensor shows the temperature or luminiscence value in the widget.
Re: Custom Widget
I don't understand what you mean with "widget". IIRC the term is no longer used in the ZWay context. I earlier versions I think it meant what we now call virtualDevice.
Re: Custom Widget
ok, sorry for the confusion. What I ment might be the virtual device, but the UI part of it. I.e when I for example create the Dummy Device, I want to be able to customize the UI so that it shows a value. In the same way all devices show their value in the little "UI-box" (whatever it's called) when you go to the "Room" and browse the devices. I know how and where to implement the backend logic behind the device, e.g. pressing the on or off button, but don't understand how the rendering of the UI is implemented and how to customize that. Don't know if I'm making myself any clearer
Re: Custom Widget
I think I now got it. I guess your bash script is going to return a value, and you want to display that additional value on for example the Dummy Device element. (They call this the elements view, hence the term I use)
I fear you have to dive very deep into the code to change that.
At the moment the App Multi Sensor offers a surrogate solution. You can define there up to 10 vDevs that appear in a pop-up window if you click on the temperature value.
That being said, I think it would be nice if App builders had a bit more control over the element. For example the time stamp in the element represents the last time that ZWay retrieved the value, not the time when this value was measured on the Weather hut. I also think there is space in the element for one or two additional defined sensor values.
Please note that your module can also change the element icon on the fly. It is done in weather modules, I do that in App SolQoS.
I fear you have to dive very deep into the code to change that.
At the moment the App Multi Sensor offers a surrogate solution. You can define there up to 10 vDevs that appear in a pop-up window if you click on the temperature value.
That being said, I think it would be nice if App builders had a bit more control over the element. For example the time stamp in the element represents the last time that ZWay retrieved the value, not the time when this value was measured on the Weather hut. I also think there is space in the element for one or two additional defined sensor values.
Please note that your module can also change the element icon on the fly. It is done in weather modules, I do that in App SolQoS.
Re: Custom Widget
Yes, that was my initial thought, but when I found the widget-wiki, I thought this was for implementing exactly what I wanted. I thought the views were template based, so it would be easily extended and customized, but apparently that's not the case.I fear you have to dive very deep into the code to change that.
Do you mean it can be changed in runtime depending on certain conditions? I haven't used the weather modules, but if that is the case it should be possible to replace the icon by a text-value, and in that way achieve what I want - i.e if you're talking about changes in runtime.Please note that your module can also change the element icon on the fly
Re: Custom Widget
Yes, the icon below does change if one of my two solar power converters produces considerable less than the other. Depending on conditions one of these icons is displayed. I don't think it will work for text.bogr wrote:Do you mean it can be changed in runtime depending on certain conditions?
Re: Custom Widget
ok, I see what you mean. I think I'll just create a copy of the MultiSensor and strip a lot of stuff and eventually turning it into a "SingleSensor", and then I should be set . Thanx for the tip.