Alexa can control emulated hue light but says "Light isn`t responding..."

change the code in hue_api.py:

def entity_to_json(config, entity, state):
    """Convert an entity to its Hue bridge JSON representation."""
    entity_features = entity.attributes.get(ATTR_SUPPORTED_FEATURES, 0)
    if (entity_features & SUPPORT_BRIGHTNESS)  or entity.domain == script.DOMAIN: 
      return {
        'state':
        {
            HUE_API_STATE_ON: state[STATE_ON],
            HUE_API_STATE_BRI: state[STATE_BRIGHTNESS],
            HUE_API_STATE_HUE: state[STATE_HUE],
            HUE_API_STATE_SAT: state[STATE_SATURATION],
            'reachable': True
        },
        'type': 'Dimmable light',
        'name': config.get_entity_name(entity),
        'modelid': 'HASS123',
        'uniqueid': entity.entity_id,
        'swversion': '123'
      }
    elif entity.domain == light.DOMAIN:
      return {
        "state": {HUE_API_STATE_ON: state[STATE_ON], "reachable": True},
        "type": "On/off light",
        "name": config.get_entity_name(entity),
        "modelid": "HASS321",
        "uniqueid": entity.entity_id,
        "swversion": "123",
      }
    else:
      return {
        "state": {HUE_API_STATE_ON: state[STATE_ON], "reachable": True},
        "type": "On/Off plug-in unit",
        "name": config.get_entity_name(entity),
        "modelid": "HASS4321",
        "uniqueid": entity.entity_id,
        "swversion": "123",
      }
1 Like