kakopappa / arduino-esp8266-alexa-multiple-wemo-switch

multiple belkin wemos switch emulator using ESP8266
https://sinric.pro
MIT License
308 stars 196 forks source link

Question on Alexa status #79

Open Jamesb4uk opened 8 months ago

Jamesb4uk commented 8 months ago

Bit of a long shot, how does this control the way Alexa sees the relay is on?

I'm using this fine with a relay which pulses a 12v diesel heater switch.

The relay is connected on the back of the on/off switch. To power on it activates the relay for 1 second then turns off the relay & the heater starts up, then turning off it activates the relay for 5 seconds to begin the shutdown sequence of the heater & turns the relay off. the Alexa switch status only stays on when the relays on.

Is it possible to keep the status as on (even when the relays off) so i can see when the heaters running?

Kind Regards James

Ynot1 commented 8 months ago

It doesn’t. Alexa only sees the relay activation status, not the state of whatever you attach to it

But I hacked around one of those two other functions that are compiled along with the main Audino sketch to achieve this by assigning another auduino pin to be the feedback towards Alexa instead. Took me ages and only works for a single control , but it’s functional , sort of.

You still can’t ask Alexa if the thing is on or off, but at least it displays correctly in the app if you look at it

But if you

Get Outlook for iOShttps://aka.ms/o0ukef


From: Jamesb4uk @.***> Sent: Sunday, November 5, 2023 6:48 AM To: kakopappa/arduino-esp8266-alexa-multiple-wemo-switch Cc: Subscribed Subject: [kakopappa/arduino-esp8266-alexa-multiple-wemo-switch] Question on Alexa status (Issue #79)

Bit of a long shot, how does this control the way Alexa sees the relay is on?

I'm using this fine with a relay which pulses a 12v diesel heater switch.

The relay is connected on the back of the on/off switch. To power on it activates the relay for 1 second then turns off the relay & the heater starts up, then turning off it activates the relay for 5 seconds to begin the shutdown sequence of the heater & turns the relay off. the Alexa switch status only stays on when the relays on.

Is it possible to keep the status as on (even when the relays off) so i can see when the heaters running?

Kind Regards James

— Reply to this email directly, view it on GitHubhttps://github.com/kakopappa/arduino-esp8266-alexa-multiple-wemo-switch/issues/79, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJFRJWTEO27M4CSFHSV7Z7LYCZ5XPAVCNFSM6AAAAAA65XDYESVHI2DSMVQWIX3LMV43ASLTON2WKOZRHE3TONBUGU2TIOI. You are receiving this because you are subscribed to this thread.Message ID: @.***>

Jamesb4uk commented 8 months ago

Thanks Ynot1

I started reading some of the other comments on how this interacts with Alexa & just built a 2nd test device to play with.

Hooking up the serial monitor is proving useful as i can see the comms to the D1 Mini

Got UDP Belkin Request..

Sending response to Port : 60562 Response sent ! Got UDP Belkin Request..

Sending response to Port : 42294 Response sent ! ########## Responding to /upnp/control/basicevent1 ... ########## request:<?xml version="1.0" encoding="utf-8"?>1</u:SetBinaryState></s:Body></s:Envelope> Got Turn on request Relay On Relay On Relay On Sending :

1

</u:GetBinaryStateResponse> </s:Body> </s:Envelope>

########## Responding to /upnp/control/basicevent1 ... ########## request:<?xml version="1.0" encoding="utf-8"?>1</u:GetBinaryState></s:Body></s:Envelope> Got binary state request Sending :

1

</u:GetBinaryStateResponse> </s:Body> </s:Envelope>

Got UDP Belkin Request..

Sending response to Port : 45728 Response sent ! ########## Responding to /upnp/control/basicevent1 ... ##########

I think the Binarystate is what I'm going to work on figuring out as when it turns of it switches to 0

I'll post back if i work it out

Kind Regards James

Ynot1 commented 8 months ago

in module switch.cpp

I defined an external boolean

extern bool GarageDoorState; (this is attached to a read of another arduino pin in the main sketch)

===-===--

I then just crudely overwrote switchStatus with that value before it is sent to Alexa (which is why this solution isnt great if you are dealing with more than 1 external thing)

if (request.indexOf("GetBinaryState") >= 0) {

switchStatus = !GarageDoorState ; ....

On Sun, Nov 5, 2023 at 11:05 AM Jamesb4uk @.***> wrote:

Thanks Ynot1

I started reading some of the other comments on how this interacts with Alexa & just built a 2nd test device to play with.

Hooking up the serial monitor is proving useful as i can see the comms to the D1 Mini

Got UDP Belkin Request..

Sending response to Port : 60562 Response sent ! Got UDP Belkin Request..

Sending response to Port : 42294 Response sent ! ########## Responding to /upnp/control/basicevent1 ... ########## request:<u:SetBinaryState xmlns:u="urn:Belkin:service:basicevent:1">1</u:SetBinaryState></s:Body></s:Envelope> Got Turn on request Relay On Relay On Relay On Sending :<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> 1 </u:GetBinaryStateResponse> </s:Body> </s:Envelope>

########## Responding to /upnp/control/basicevent1 ... ########## request:<u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1">1</u:GetBinaryState></s:Body></s:Envelope> Got binary state request Sending :<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> 1 </u:GetBinaryStateResponse> </s:Body> </s:Envelope>

Got UDP Belkin Request..

Sending response to Port : 45728 Response sent ! ########## Responding to /upnp/control/basicevent1 ... ##########

I think the Binarystate is what I'm going to work on figuring out as when it turns of it switches to 0

I'll post back if i work it out

Kind Regards James

— Reply to this email directly, view it on GitHub https://github.com/kakopappa/arduino-esp8266-alexa-multiple-wemo-switch/issues/79#issuecomment-1793565886, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJFRJWRUR5TKK2KBQB2DTY3YC23ZJAVCNFSM6AAAAAA65XDYESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJTGU3DKOBYGY . You are receiving this because you commented.Message ID: <kakopappa/arduino-esp8266-alexa-multiple-wemo-switch/issues/79/1793565886 @github.com>

Jamesb4uk commented 8 months ago

Thanks again.

I was actually looking at switch.cpp & going down the road that you have done last night its a on/off switch so no issues for me.

Interesting, you did a not operation on GarageDoorState, maybe its Monday brain shock how does that work with switchstatus?

James

Ynot1 commented 8 months ago

GarageDoorState; (this is attached to a read of another arduino pin in the main sketch)

Get Outlook for iOShttps://aka.ms/o0ukef


From: Jamesb4uk @.> Sent: Tuesday, November 7, 2023 8:45:45 AM To: kakopappa/arduino-esp8266-alexa-multiple-wemo-switch @.> Cc: Ynot1 @.>; Comment @.> Subject: Re: [kakopappa/arduino-esp8266-alexa-multiple-wemo-switch] Question on Alexa status (Issue #79)

Thanks again.

I was actually looking at switch.cpp & going down the road that you have done last night its a on/off switch so no issues for me.

Interesting, you did a not operation on GarageDoorState, maybe its Monday brain shock how does that work with switchstatus?

James

— Reply to this email directly, view it on GitHubhttps://github.com/kakopappa/arduino-esp8266-alexa-multiple-wemo-switch/issues/79#issuecomment-1796192607, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJFRJWQ4SIG6TN25OQ5A5ITYDE46TAVCNFSM6AAAAAA65XDYESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJWGE4TENRQG4. You are receiving this because you commented.Message ID: @.***>

Jamesb4uk commented 8 months ago

ok i think i understand, will give it a try.

Appreciate your help in this

James