MisterWil / abodepy

A thin Python wrapper for the Abode alarm API
MIT License
49 stars 17 forks source link

Dimmer #22

Closed ahutchings closed 6 years ago

ahutchings commented 6 years ago

This is the JSON for a Z-Wave dimmer (GE Z-Wave Plus In-Wall Smart Dimmer) connected through Abode.

I am able to control the on/off state through HASS currently (the dimmer shows up as a light), but not the dimmer percentage.

{
  "id": "ZW:0000000b",
  "type_tag": "device_type.dimmer",
  "type": "Dimmer",
  "name": "West Deck Light",
  "area": "1",
  "zone": "10",
  "sort_order": "",
  "is_window": "",
  "bypass": "0",
  "schar_24hr": "0",
  "sresp_24hr": "0",
  "sresp_mode_0": "0",
  "sresp_entry_0": "0",
  "sresp_exit_0": "0",
  "group_name": "Lights",
  "group_id": "<snip>",
  "default_group_id": "1",
  "sort_id": "1",
  "sresp_mode_1": "0",
  "sresp_entry_1": "0",
  "sresp_exit_1": "0",
  "sresp_mode_2": "0",
  "sresp_entry_2": "0",
  "sresp_exit_2": "0",
  "sresp_mode_3": "0",
  "uuid": "<snip>",
  "sresp_entry_3": "0",
  "sresp_exit_3": "0",
  "sresp_mode_4": "0",
  "sresp_entry_4": "0",
  "sresp_exit_4": "0",
  "version": "",
  "origin": "abode",
  "has_subscription": null,
  "control_url": "api/v1/control/light/ZW:0000000b",
  "deep_link": null,
  "status_color": "#5cb85c",
  "faults": {
    "low_battery": 0,
    "tempered": 0,
    "supervision": 0,
    "out_of_order": 0,
    "no_response": 0
  },
  "status": "Off",
  "statuses": {
    "saturation": "N/A",
    "hue": "N/A",
    "level": "0",
    "switch": "0",
    "color_temp": "N/A",
    "color_mode": "N/A"
  },
  "status_ex": "",
  "actions": [
    { "label": "Switch off", "value": "a=1&z=10&sw=off;" },
    { "label": "Switch on", "value": "a=1&z=10&sw=on;" },
    { "label": "Toggle", "value": "a=1&z=10&sw=toggle;" },
    { "label": "0%", "value": "a=1&z=10&sw=0;" },
    { "label": "10%", "value": "a=1&z=10&sw=10;" },
    { "label": "20%", "value": "a=1&z=10&sw=20;" },
    { "label": "30%", "value": "a=1&z=10&sw=30;" },
    { "label": "40%", "value": "a=1&z=10&sw=40;" },
    { "label": "50%", "value": "a=1&z=10&sw=50;" },
    { "label": "60%", "value": "a=1&z=10&sw=60;" },
    { "label": "70%", "value": "a=1&z=10&sw=70;" },
    { "label": "80%", "value": "a=1&z=10&sw=80;" },
    { "label": "90%", "value": "a=1&z=10&sw=90;" },
    { "label": "100%", "value": "a=1&z=10&sw=99;" }
  ],
  "status_icons": [],
  "statusEx": "0",
  "icon": "assets/icons/bulb-1.svg"
}
shred86 commented 6 years ago

Dimmer support should work now with AbodePy 0.12.3. I also submitted a pull request in the Home Assistant repository to make changes to the Abode light component so dimmers will work correctly:

ahutchings commented 6 years ago

Thanks, I see the dimmer control in HA now! Closing this issue.

shred86 commented 6 years ago

The updated Home Assistant Abode light component isn't included in HA 0.67 but should be in the next release (it's in the dev build right now). While dimmers will show up right now (since Abodepy was updated), just realize the code to convert the HA brightness value to what Abode uses isn't there yet (it's in 0.68) so the brightness sliders might be a little off in HA right now.