As I am completly ignorant with css I would like if someone could help with a custom widget.
I want to have the top part of the Thermostat widget and botom-mode selection part of the Air Condition widget.
Fan speed selection as on Thermostat (o=off, 33=Min, 67=Mid, 100=Max) and mode (0=Auto, 1=Heating, 3=Cooling, 9=Fan, 14=Dry)
For this you will need to know JavaScript.
Link the output of this object to a virtual object and depend of the value you get write to your object. The fan speed you can set in widget parameters.
(24.08.2020, 07:37)Daniel. Wrote: For this you will need to know JavaScript.
Link the output of this object to a virtual object and depend of the value you get write to your object. The fan speed you can set in widget parameters.
Can you please share the script, style sheet from the thermostat widget so i can have a starting point?
(24.08.2020, 12:23)Daniel. Wrote: I'm not sure what are the values sent on output of the mode but I guess it is 0,1,2,3,4. Change it accordingly Then the script would looks like that
Code:
value = event.getvalue()
if (value == 0) then
grp.write('1/1/1', 0)
elseif (value == 1) then
grp.write('1/1/1', 1)
elseif (value == 2) then
grp.write('1/1/1', 3)
elseif (value == 3) then
grp.write('1/1/1', 9)
elseif (value == 4) then
grp.write('1/1/1', 13)
end
There is no need to create another script for something that could be done native from the widget.
Sorry about this never ending posting from me... Could you share the latest version of this widget, Daniel? I would like to make a small addition for "Heating message" and "Cooling message"...
I was really not planning to bother you more with questions about this. I can import the widget just fine from the Extensions box, but it does not show up when I "Add new widget"... Have of course renamed the widget, and also tried other changes.
Yesterday, 10:25 (This post was last modified: Yesterday, 10:27 by stianj.)
(Yesterday, 09:57)Daniel Wrote: You also need to change it in line 207
WidgetView.thermostat_new = WidgetView.extend({
I did, it won't import if not... (Or maybe it will import, but as they were they had ['thermostat'] as ID, and that did not import... So I did change both...)
Attached. I have tried many things, not just what I have attached. I have tried to just change the ID both places, I have changed the Title in line 4, and finally I replaced all "se-thermostat." with "thermostat-new.". (Not sure if that have unexpected caveats I have not yet discovered, but it didn't work before I did that neither...)
All of the different version imports, but none is visible when trying to add the widget.
I have not studied the code yet, and I do understand there are caveats here, but I'm pretty sure I'll figure that out when I can start testing changes...