I have 2 devices that have the same name and the same location but have different device codes C12 and U5. If I right click in the HS GUI and send a C12 on the log reports C12 on. If I send a U5 on the log shows U5 on. All normal. BUT if I use the built in web interface and click on the off for C12 it sends a U5 off. If I click on the off button for U5 it sends U5 off. Why?
Announcement
Collapse
No announcement yet.
Weirdest HS error I have ever encountered
Collapse
X
-
rocco
This is my hypothesis:
The button is associated to the name, not the house/unit code. Both names are the same, but the U5 one is always found first.
Comment
-
twittydavis
Yeah my initial thoughts were that the button was associated with the name as well, but when I looked at the source for the page it's assigning some sort of unique identifer for each device, which appears to have nothing in common with either the name or device number. You can see the id after clicking on the button as well, it's something like "dev900934".
I noticed that it always operates on the topmost device in the list. If you sort them in a different order does it still operate on the top device?
Mick
Comment
-
Ruppster,
Contrary to what you may be thinking, that is not a bug - it's a feature! No, seriously! I'll explain...
Although I often wrinkle my forehead when I run across some weird stuff in Rich's code, the answer for it is always lodged in some logic or t'other.
In this case, the on/off/dim buttons on the screen are enclosed in a small sub-form, and so they do not use the unique device reference ID that was pointed out as being a part of each device line. In the small sub-form the field is control_device and it does use the device location and name. Thus, if you gave them different names, your problem would definitely go away.
The reason it uses location and name was so that you, the users, could control a device using a URL that is formed and including something like this as a field in your custom web page or ASP: Name="control_device" Value="Bathroom Light=On". If you do a search on this board for control_device, you will actually find 4-5 posts that reference using this.
So there you have it!
Now then, since I personally don't like our UI using location and name, but I don't want to break what some users use and count on to be there, I am going to make a change in HS 2.0 to use the internal device reference (perhaps with a different field name) but still allow the use of the control_device field in the same way it has been used for years.Regards,
Rick Tinker (a.k.a. "Tink")
Comment
Comment