All done! It seems to work since at the device discovery the new capability is displayed! I cannot test the functionality to ask about the device, but the routine is working very well!!!!!philchillbill wrote: ↑Tuesday 26 November 2019 21:32 To make sure you are reporting EndpointHealth, the following changes need to be made to the Lambda files:
In AlexaSmartHome.py. add:
At the top of the method serializeProperties, under the 'for prop in self.propertiesSupported():', after 'prop_name = prop['name']', addCode: Select all
@INTERFACES.register('Alexa.EndpointHealth') class AlexaEndpointHealth(AlexaInterface): def name(self): return 'Alexa.EndpointHealth' def propertiesSupported(self): return [{'name': 'connectivity'}]
Finally, in DomoticzHandler.py, close to the start of the file and immediately under 'class DomoticzEndpoint(AlexaEndpoint):' add the following:Code: Select all
if prop_name == 'connectivity': prop_value = { 'value': 'OK' }
After doing that, do a device discovery to add this new capability to all your endpoints. Without it, change reports work in routines but you cannot ask if a door is open or closed. With it, you can ask "Alexa, is the front door open" and get a spoken response "Front door is closed".Code: Select all
def __init__(self, endpointId, friendlyName='', description='', manufacturerName=''): super().__init__(endpointId, friendlyName, description, manufacturerName) self.addCapability(AlexaEndpointHealth(self, 'Alexa.EndpointHealth',[{'name': 'connectivity'}])) self._device_ = None
Thank @phill for your support!