Skip to content

How to make the state returned to Alexa from another gpio pin. #48

@Ynot1

Description

@Ynot1

Lots of success with this code today after changing the persistent_uuid line in switch.cpp as pointed out by others. That's really helpful guys, thanks.
My Alexa Plus is discovering the devices without any additional skills, and controlling the resulting relays just fine.

My use case is a garage door control, that wants 1 sec pulses to either open or close the door. I have modified the code in this repo to read a gpio input pin on the esp2866 that is connected to a switch so I know the state of the door. Simple then to gate the Alexa on and off commands via that garageDoorState Boolean to only produce a close pulse when the door is open and vice versa.

The only problem with this, is that Alexa doesn't know the actual state of the door, only the state of the door control relays , and as they are always short pulses, when I look at the belkin smart switch device display in Alexas list of devices, it's always off.

Where in the code could I make changes such that the state of the door is returned to Alexa instead of the state of the door controls? I would like to see those smart switch displays in Alexa say "on" when the door is open. (This could be really useful if I ever want to know remotely if I have left the door open)

I can see regular " got binary state request" messages in the serial monitor which is probably where I need to make changes, but I lack the understanding of exactly how...

Apart from the tweak above, and removing most of the debug messages to make life quieter, I haven't touched the library files (yet).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions