Can set dimmable light via VeraLite, but reading fails "after a while"

I’m slowly building up my control and I’m now adding lighting control.

I have a dimmable light managed via VeraLite and I have bound a slider and a label to DimmableLight.Level.

When I start the simulator, HR seems unable to read the current settings. But if I move the slider, the lights actually change and the values shown on the U/I controls change.

But “after a while” – sometimes a few seconds, sometimes almost a minute – the slider returns to 0 and the label is cleared.

This sounds to me like a polling thing.

When I connect to the VeraLite control panel, VeraLite is set to poll the light at most once every 60 seconds.

In the scheme of things, being able to set the level from HR is good; displaying the correct value would be nice but not essential. But it is a bit odd.

Is there anywhere else I should look or anything I should change to help with this?

Thanks.

P.S. The U/I of the VeraLite control panel shows the level (as a %) constantly, without the problem I described I’m seeing with my HR project. I don’t know how it polls the light switch itself and if/how that’s different from what HR does.

For a dimmable light’s brightness, the Home Remote uses the level property in the sdata. It sounds like your device may be using something different. Open this URL & search the JSON for your device. Let me know which property (if any) has your light’s current level.
http://192.168.1.148:3480/data_request?id=sdata

IIUC it’s also using level:

{
  "full": 1,
  "version": "*1.5.622*",
  "model": "MiCasaVerde VeraLite",
  "zwave_heal": 1,
  "temperature": "F",
  "serial_number": "35013647\n",
  "fwd1": "fwd1.mios.com",
  "fwd2": "fwd2.mios.com",
  "sections": [
    {
      "name": "My Home",
      "id": 1
    }
  ],
  "rooms": [
    {
      "name": "Media room",
      "id": 1,
      "section": 1
    }
  ],
  "scenes": [],
  "devices": [
    {
      "name": "Dimmable Light",
      "altid": "2",
      "id": 3,
      "category": 2,
      "subcategory": 0,
      "room": 1,
      "parent": 1,
      "level": "0",
      "status": "0",
      "state": -1,
      "comment": ""
    }
  ],
  "categories": [
    {
      "name": "Dimmable Light",
      "id": 2
    }
  ],
  "ir": 0,
  "irtx": "",
  "loadtime": 1609634096,
  "dataversion": 634099990,
  "state": -1,
  "comment": ""
}

OK. Does the value in the JSON match the value the Home Remote is displaying?

The Home Remote should be displaying 0 now.

I set the level to 50% manually. The curl output shows 50.

When I start the sim I see the slider flash momentarily to what I think is the 50% position before it pretty quickly returns to 0 and the label is cleared, not set to “0” which seems significant.

I have a script tied to when the slider is loaded; it looks up the lighting level and logs it to the console and I see this:

At load, lighting switch is Unknown and level is null

Here’s the script:

sleep(150);
var lightingLevel = App.GetDeviceAttribute("DimmableLight.Level");
var lightingSwitch = App.GetDeviceAttribute("DimmableLight.Switch");
console.log("At load, lighting switch is " + lightingSwitch + " and level is " + lightingLevel );

What does the sdata look like? That’s the important part.

The Home Remote should show the same value it has.

Here’s the relevant part of the curl output:

  "devices": [
    {
      "name": "Dimmable Light",
      "altid": "2",
      "id": 3,
      "category": 2,
      "subcategory": 0,
      "room": 1,
      "parent": 1,
      "status": "1",
      "level": "51",
      "state": -1,
      "comment": ""
    }
  ],
  "categories": [
    {
      "name": "Dimmable Light",
      "id": 2
    }
  ],

Here’s the curl command I’m using:

curl http://192.168.2.23:3480/data_request?id=sdata | jq

OK. So if you were to start the simulator now you should see 51%.

Yes, that’s what I expect. But I start the sim and the slider jumps to the 51% mark – and the label also flashes – and then the slider goes back to the zero position and the label goes blank.

If there’s any further logging I can add to my project or that I can turn on in some way for the sim that would help with this, just let me know.

Would you mind sending me your project so I can try running it on my machine?

Maybe something with your Slider config is breaking it. Try creating a simple page with just a Label that shows the dimming level. Better yet too, create an entirely new project. Let’s try to eliminate any possibility that something you’re doing is corrupting it. Really sounds like it’s disconnecting from the Vera.

I’ll try that before shipping the project off to you. Maybe not until tomorrow, though. Thanks for all the help.

If it’s disconnecting, it’s probably not only the dimmer that has this issue. All of your other Vera device Labels will go blank or display Unknown as well.

Here’s the bare-bones project: https://www.dropbox.com/s/m405r3lwes3o6qu/SimpleLighting.hrp?dl=0

I see the same behavior as earlier: The label starts out as empty. There’s about a second or so delay, then the label flashes very briefly with the current lighting level, but then the label is cleared again.

It’s not 0%, it’s blank. So that lines up with my earlier console logging indicating the Level is coming back as Unknown.

I normally just have people private message or email me files like this, especially for projects that have credentials. That way you don’t have to worry about any unauthorized users getting ahold of it. You may want to take that down. Also, be sure you have EnableCloudAccess checked. I will not be able to connect to a private IP address that is only accessible on your network. Your other option would be to set up port forwarding. My email is support@thehomeremote.com

I’d removed my credentials before saving the project for precisely that reason.

I’ll take down the dropbox file. Let me make see about using a public URL for the connection. As you pointed out, port forwarding is an option also.

I’ll email you or DM you with the updated connection details and the updated project.

Fascinating. In preparing to share the updated project with you, I find that using the external URL (instead of the internal local address) to connect to the VeraLite device allows the slider to function correctly!

So this looks resolved although I’m sure at some point I’ll go down the rabbit hole of investigating why using the internal address does not work.

Appreciate the help.