Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emulated hue lights discovered as lights #1251

Closed
alandtse opened this issue Apr 17, 2021 · 4 comments · Fixed by #1253
Closed

Emulated hue lights discovered as lights #1251

alandtse opened this issue Apr 17, 2021 · 4 comments · Fixed by #1253
Assignees

Comments

@alandtse
Copy link
Owner

alandtse commented Apr 17, 2021

Describe the bug
With the inclusion of light support, emulated_hue lights are being detected and exposed. They should be filtered out since they already should exist in HA.

To Reproduce
Steps to reproduce the behavior:

  1. Enable emulated hue for any existing switch in HA
  2. Enable lights in options
  3. Lights will be added to HA

Expected behavior
A clear and concise description of what you expected to happen.
Emulated hue lights should be ignored

Screenshots
If applicable, add screenshots to help explain your problem.

System details

  • Home-assistant (version):
  • Hassio (Yes/No): (Please note you may have to restart hassio 2-3 times to load the latest version of alexapy after an update. This looks like a HA bug).
  • alexa_media (version from const.py or HA startup): dev
  • alexapy (version from pip show alexapy or HA startup):
  • Amazon 2FA is enabled (y/n). We will not debug login issues if unanswered:

Logs
Please provide logs. We'll be most likely asking for them anyway.

Additional context
Add any other context about the problem here.

@alandtse
Copy link
Owner Author

alandtse commented Apr 17, 2021

They are exposed http://HA/api/pi/lights to Alexa as:

{
   "1":{
      "state":{
         "on":true,
         "reachable":true,
         "mode":"homeautomation"
      },
      "name":"Abode Updates",
      "uniqueid":"00:61:47:df:43:92:f1:39-af",
      "manufacturername":"Home Assistant",
      "swversion":"123",
      "type":"On/Off light",
      "productname":"On/Off light",
      "modelid":"HASS321"
   }
}

On Amazon's side

{
   "AAA_SonarCloudService_4ea4fe55-85eb-3856-bc29-01588503c426_1":{
      "applianceId":"AAA_SonarCloudService_4ea4fe55-85eb-3856-bc29-01588503c426_1",
      "endpointTypeId":"",
      "driverIdentity":{
         "namespace":"AAA",
         "identifier":"SonarCloudService"
      },
      "manufacturerName":"Royal Philips Electronics",
      "friendlyDescription":"Royal Philips Electronics smart device",
      "modelName":"",
      "deviceType":"",
      "version":"0",
      "friendlyName":"Abode Updates",
      "friendlyNameModifiedAt":1600465801510,
      "capabilitiesModifiedAt":1600465801510,
      "ipAddress":"",
      "port":"",
      "entityId":"e9b24cb4-bb21-435a-9f07-5829692d479e",
      "applianceNetworkState":{
         "reachability":"REACHABLE",
         "lastSeenAt":1618698573170,
         "createdAt":1600465801510,
         "lastSeenDiscoverySessionId":{
            "value":"d0cf49da-3fe5-4925-bf04-86a42ddaafec"
         }
      },
      "tags":{
         "tagNameToValueSetMap":{
            
         }
      },
      "additionalApplianceDetails":{
         "additionalApplianceDetails":{
            
         }
      },
      "firmwareVersion":"0",
      "actions":[
         
      ],
      "capabilities":[
         {
            "capabilityType":"AVSInterfaceCapability",
            "type":"AlexaInterface",
            "version":"3",
            "properties":{
               "supported":[
                  {
                     "name":"powerState"
                  }
               ],
               "proactivelyReported":false,
               "retrievable":true,
               "readOnly":false
            },
            "interfaceName":"Alexa.PowerController"
         }
      ],
      "applianceTypes":[
         "LIGHT"
      ],
      "isEnabled":true,
      "aliases":[
         
      ],
      "connectedVia":"Hue Hub",
      "alexaDeviceIdentifierList":[
         
      ],
      "applianceKey":"e9b24cb4-bb21-435a-9f07-5829692d479e",
      "ipaddress":"",
      "applianceLambdaControlled":true,
      "applianceDriverIdentity":{
         "namespace":"AAA",
         "identifier":"SonarCloudService"
      },
      "mergedApplianceIds":[
         "AAA_SonarCloudService_4ea4fe55-85eb-3856-bc29-01588503c426_1"
      ]
   }
}

Initial attempt to filter on hass model names won't work as non-lights do not show the modelid e.g., "HASS123"

@blm126
Copy link
Contributor

blm126 commented Apr 18, 2021

I think the best way is to go the other way around. I have some actual hue bulbs connected directly to my Echo. They report a capability of "Alexa.EndpointHealth". So, if there if a manufacturerName of "Royal Philips Electronics" AND it doesn't have that capability, its an emulated device.

PR coming shortly.

@alandtse
Copy link
Owner Author

I think you're right. That's a consistent filter on what I'm seeing in my system.

@alandtse
Copy link
Owner Author

Please note to rebase on dev, I've fixed the style.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants