Virtual HTTP Devices plug-in - light bulb status
-
Virtual HTTP Devices plug-in:
I wanted to try this out. Installed the plugin and created one device, which came up as a light bulb. So far so good. In AltUI I clicked on the On/Off slider on the page. The log shows that the Target is set to one. Likewise for the Variable list in AltUI. However the Status never gets set to one and the light bulb icon doesn't go yellow.
In some plugins you set the Target and then the plugin checks the physical device actually went on by checking an actual status report from the device, which can be used to set the variable Status.
In other cases a plugin will send a message to the physical device but that device will have no status feedback mechanism available. So the Status variable has to be set locally when the Target is set and everybody hopes the physical device all worked.
Not to sure what Virtual HTTP Devices plug-in does in this regard? Does the above go in anyway to explaining what I'm seeing? Is the plugin looking for status feedback?
-
From the doc:
If you want to automatically acknowledge the command, simply return a status code from 200 (included) to 400 (excluded). That's what devices will do anyway.
If you want to control the result, simply return a different status code (ie 112) and then update the variable on your own via Vera/openLuup HTTP interface.
This is useful if you have an API that supports retry logic and you want to reflect the real status of the external devices.
Remarks: this feature doesn't work with curl commands.
So, Target is set at the very same moment you click, but Status is set when the command is executed. What kind of command are you trying to execute? This could be a bug, but I need to know what command you're trying to execute. Thanks!
-
From the doc:
If you want to automatically acknowledge the command, simply return a status code from 200 (included) to 400 (excluded). That's what devices will do anyway.
If you want to control the result, simply return a different status code (ie 112) and then update the variable on your own via Vera/openLuup HTTP interface.
This is useful if you have an API that supports retry logic and you want to reflect the real status of the external devices.
Remarks: this feature doesn't work with curl commands.
So, Target is set at the very same moment you click, but Status is set when the command is executed. What kind of command are you trying to execute? This could be a bug, but I need to know what command you're trying to execute. Thanks!
In the DALI plugin I wrote; I had a lot of problems trying to get the status to be shown correctly. It's probably still not correct. Why DALI? Insurance would not cover any "newer" hardware devices installed in the building fabric. DALI being a well established technology - well that's OK. The building industry is very conservative here - especially if you have to guarantee your product for quite some years - six or seven. Not unreasonable.
In the Virtual HTTP plugin, I'm doing two things that result in not seeing the yellow icon (ie status being set to on):
luup.call_action("urn:upnp-org:serviceId:SwitchPower1", "SetTarget", {newTargetValue="1"}, device_number)
and in AltUI just clicking on the On/Off.
Note: I have not configured any other variables, such as any of the http: strings, etc.
Losing the MIOS Wiki is not going to help any of us. A little bit annoyed as I contributed to it.
-
In the DALI plugin I wrote; I had a lot of problems trying to get the status to be shown correctly. It's probably still not correct. Why DALI? Insurance would not cover any "newer" hardware devices installed in the building fabric. DALI being a well established technology - well that's OK. The building industry is very conservative here - especially if you have to guarantee your product for quite some years - six or seven. Not unreasonable.
In the Virtual HTTP plugin, I'm doing two things that result in not seeing the yellow icon (ie status being set to on):
luup.call_action("urn:upnp-org:serviceId:SwitchPower1", "SetTarget", {newTargetValue="1"}, device_number)
and in AltUI just clicking on the On/Off.
Note: I have not configured any other variables, such as any of the http: strings, etc.
Losing the MIOS Wiki is not going to help any of us. A little bit annoyed as I contributed to it.
@a-lurker Ok, but what's inside variables for on/off status? if you don't need to call http/mqtt endpoints, just specify skip and it should work.
I have a couple of virtual devices monitored by MSR where I'm doing the very same thing, so skip is setting variables and you could execute actions/commands in your favorite way.
Otherwise, set debug variable to 1 and see what's inside logs.
-
Hello @therealdb and once again thank you for this app!
- I believe that
MeterPowerFormat : meters[1].power
MeterTotalFormat : meters[1].totalis mixed up.
MeterPowerFormat : meters[1].total
MeterTotalFormat : meters[1].powerGives the right values for my Shellies with ipadr/status.
-
I am struggling a little to get MeterPowerUnit to work.
Should “urn:bochicchio-com:serviceId:VirtualBinaryLight1” be the service? It is what I have tried. -
Found this error in the log. Updating does not work
01 11/29/22 11:24:20.100 GetLuaInterface can't find device type: 4/0x12affa8 str: 2370 <0x73c1e520> 01 11/29/22 11:24:20.101 luup_variable_get interface 0xee4200 args 3 <0x73c1e520> 50 11/29/22 11:24:20.102 luup_log:2370: VirtualBinaryLight[2.3.0@2370]:updateMeters: disabled <0x73c1e520>
-
Hello @therealdb and once again thank you for this app!
- I believe that
MeterPowerFormat : meters[1].power
MeterTotalFormat : meters[1].totalis mixed up.
MeterPowerFormat : meters[1].total
MeterTotalFormat : meters[1].powerGives the right values for my Shellies with ipadr/status.
-
I am struggling a little to get MeterPowerUnit to work.
Should “urn:bochicchio-com:serviceId:VirtualBinaryLight1” be the service? It is what I have tried. -
Found this error in the log. Updating does not work
01 11/29/22 11:24:20.100 GetLuaInterface can't find device type: 4/0x12affa8 str: 2370 <0x73c1e520> 01 11/29/22 11:24:20.101 luup_variable_get interface 0xee4200 args 3 <0x73c1e520> 50 11/29/22 11:24:20.102 luup_log:2370: VirtualBinaryLight[2.3.0@2370]:updateMeters: disabled <0x73c1e520>
@bobone time for me to take the dust off my old test Vera and check it all again.
Unfortunately I'm traveling until Saturday and I have a busy agenda for the weekend, but next week is public holiday for us in Italy/Milan, so I hope to have time to investigate. Please bear with me while I'm trying to survive to life and business tasks -
Solved!
The bugs were in 2.3.
Could not update the app within Vera as 2.3 is the latest version.
Had never updated files manually before, but used your latest Beta that seems to work.I suppose the remaining problem is that the documentation makes one believe that the power functions work with 2.3. Two alternatives:
- either update the app (best)
- or comment the documentation
Anyway, thank you!