n8henrie / fauxmo-plugins

Plugins for Fauxmo (emulated Wemo devices for the Amazon Echo)

Home Page:https://github.com/n8henrie/fauxmo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GetBinaryState fails if state is not in {`on`, `off`} which prevents adding new devices with unknown state

jdodgen opened this issue · comments

  • Issues not following the template may be closed for that reason alone.

  • Operating system and version

  • :
    PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
    NAME="Debian GNU/Linux"
    VERSION_ID="11"
    VERSION="11 (bullseye)"
    VERSION_CODENAME=bullseye
    ID=debian
    HOME_URL="https://www.debian.org/"
    SUPPORT_URL="https://www.debian.org/support"
    BUG_REPORT_URL="https://bugs.debian.org/"

  • Python version: 3.9.2

  • Fauxmo version): v0.6.0

  • Echo device type (e.g. Echo, Echo Plus, Dot): Many Dot's running on LAN

  • Echo Firmware Version: not a dot problem

I have been playing with mqttplugin.py for a couple of hours and always get the same error:
" WARNING Unable to complete command for foo:". When I have "Alexa discover devices" .
BTW the mqtt client(s) are working fine. I use the same version of fauxmo using the http interface and it is working fine.

So the "discover devices" search found this computer but from the messages the "discover" failed.
the config and trace are below.

any ideas?

/etc/fauxmo/config.json:

{
    "FAUXMO": {
        "ip_address": "auto"
    },
    "PLUGINS": {
        "MQTTPlugin": {
            "path": "mqttplugin.py",
            "DEVICES": [
                {
                    "port": 56880,
                    "name": "foo",
                    "on_cmd": [ "button", "on" ],
                    "off_cmd": [ "button", "off" ],
                    "state_cmd": "button",
                    "mqtt_server": "192.168.0.173",
                    "mqtt_port": 1883
                }
            ]
        }
    }
}
verbose output
jim@home-broker:~ $ fauxmo -vvv
2023-04-06 06:40:12 fauxmo:42       INFO     Fauxmo v0.6.0
2023-04-06 06:40:12 fauxmo:43       DEBUG    3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110]
2023-04-06 06:40:12 fauxmo:51       INFO     Using config: /etc/fauxmo/config.json
2023-04-06 06:40:12 fauxmo:26       DEBUG    Attempting to get IP address automatically
2023-04-06 06:40:12 fauxmo:41       DEBUG    Using IP address: 192.168.0.173
2023-04-06 06:40:12 fauxmo:112      DEBUG    plugin_vars: {}
2023-04-06 06:40:12 fauxmo:118      DEBUG    device config: {'port': 56880, 'name': 'foo', 'on_cmd': ['button', 'on'], 'off_cmd': ['button', 'off'], 'state_cmd': 'button', 'mqtt_server': '192.168.0.173', 'mqtt_port': 1883}
2023-04-06 06:40:12 asyncio:1521     INFO     <Server sockets=(<asyncio.TransportSocket fd=8, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.0.173', 56880)>,)> is serving
2023-04-06 06:40:12 fauxmo:133      DEBUG    Started fauxmo device: {'name': 'foo', 'plugin': MQTTPlugin(on_cmd='button', on_value='on', off_cmd='button', off_value='off', state_cmd='button', status='unknown', _subscribed=True, client=<paho.mqtt.client.Client object at 0xffff8cc6f1c0>, _name='foo', _port=56880, _latest_action='off')}
2023-04-06 06:40:12 fauxmo:135      INFO     Starting UDP server
2023-04-06 06:40:12 asyncio:1375     DEBUG    Datagram endpoint remote_addr=None created: (<_SelectorDatagramTransport fd=11 read=idle write=<idle, bufsize=0>>, <fauxmo.protocols.SSDPServer object at 0xffff8d56a940>)
2023-04-06 06:40:32 fauxmo:344      DEBUG    Received data below from ('192.168.0.8', 48334):
2023-04-06 06:40:32 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
MAN: "ssdp:discover"
MX: 5
ST: upnp:rootdevice


2023-04-06 06:40:32 fauxmo:420      DEBUG    Sending response to ('192.168.0.8', 48334) with mx 5.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:32 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: 7399b663-0224-416c-a152-fc1415f081db\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: upnp:rootdevice\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::upnp:rootdevice\r\n\r\n'
2023-04-06 06:40:32 fauxmo:344      DEBUG    Received data below from ('192.168.0.43', 50000):
2023-04-06 06:40:32 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: ssdp:all
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:32 fauxmo:420      DEBUG    Sending response to ('192.168.0.43', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:32 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: 4466e99b-246d-4bd7-a4ca-0bfdeb01a4bc\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: ssdp:all\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::ssdp:all\r\n\r\n'
2023-04-06 06:40:32 fauxmo:344      DEBUG    Received data below from ('192.168.0.43', 50000):
2023-04-06 06:40:32 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: upnp:rootdevice
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:32 fauxmo:420      DEBUG    Sending response to ('192.168.0.43', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:32 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: 82610684-abf3-4bd9-9b54-edba5c80c2b4\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: upnp:rootdevice\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::upnp:rootdevice\r\n\r\n'
2023-04-06 06:40:32 fauxmo:344      DEBUG    Received data below from ('192.168.0.105', 50000):
2023-04-06 06:40:32 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: ssdp:all
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:32 fauxmo:420      DEBUG    Sending response to ('192.168.0.105', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:32 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: 4a0020dd-6dcf-40e7-84ab-65b8ee1ea43a\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: ssdp:all\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::ssdp:all\r\n\r\n'
2023-04-06 06:40:32 fauxmo:344      DEBUG    Received data below from ('192.168.0.105', 50000):
2023-04-06 06:40:32 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: upnp:rootdevice
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:32 fauxmo:420      DEBUG    Sending response to ('192.168.0.105', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:32 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: a17ccd4f-11c6-407d-8fbd-320ba122cc47\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: upnp:rootdevice\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::upnp:rootdevice\r\n\r\n'
2023-04-06 06:40:32 fauxmo:344      DEBUG    Received data below from ('192.168.0.101', 50000):
2023-04-06 06:40:32 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: ssdp:all
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:32 fauxmo:420      DEBUG    Sending response to ('192.168.0.101', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:32 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: fc09bdf0-7825-4348-a179-d314d62df6b0\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: ssdp:all\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::ssdp:all\r\n\r\n'
2023-04-06 06:40:32 fauxmo:344      DEBUG    Received data below from ('192.168.0.101', 50000):
2023-04-06 06:40:32 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: upnp:rootdevice
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:32 fauxmo:420      DEBUG    Sending response to ('192.168.0.101', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:32 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: 2ce9cc09-d3e2-48b4-bd2b-9957414da15f\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: upnp:rootdevice\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::upnp:rootdevice\r\n\r\n'
2023-04-06 06:40:32 fauxmo:344      DEBUG    Received data below from ('192.168.0.127', 50000):
2023-04-06 06:40:32 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: ssdp:all
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:32 fauxmo:420      DEBUG    Sending response to ('192.168.0.127', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:32 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: 55b68b3c-ab09-4215-8d09-c3e3a9a50835\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: ssdp:all\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::ssdp:all\r\n\r\n'
2023-04-06 06:40:32 fauxmo:344      DEBUG    Received data below from ('192.168.0.127', 50000):
2023-04-06 06:40:32 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: upnp:rootdevice
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:32 fauxmo:420      DEBUG    Sending response to ('192.168.0.127', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:32 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: 5f9352c7-da52-42ac-b589-fa8be0e358b6\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: upnp:rootdevice\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::upnp:rootdevice\r\n\r\n'
2023-04-06 06:40:32 fauxmo:344      DEBUG    Received data below from ('192.168.0.102', 50000):
2023-04-06 06:40:32 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: ssdp:all
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:32 fauxmo:420      DEBUG    Sending response to ('192.168.0.102', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:32 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: 1368d23c-24f6-4fdf-8922-cb8cd115d4b5\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: ssdp:all\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::ssdp:all\r\n\r\n'
2023-04-06 06:40:32 fauxmo:344      DEBUG    Received data below from ('192.168.0.102', 50000):
2023-04-06 06:40:32 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: upnp:rootdevice
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:32 fauxmo:420      DEBUG    Sending response to ('192.168.0.102', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:32 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: d54eb964-3efd-4c4a-b9a6-cb6d517eb6ab\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: upnp:rootdevice\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::upnp:rootdevice\r\n\r\n'
2023-04-06 06:40:32 asyncio:166      DEBUG    <Server sockets=(<asyncio.TransportSocket fd=8, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.0.173', 56880)>,)> got a new connection from ('192.168.0.102', 54290): <socket.socket fd=12, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.0.173', 56880), raddr=('192.168.0.102', 54290)>
2023-04-06 06:40:32 fauxmo:43       DEBUG    Connection made with: ('192.168.0.102', 54290)
2023-04-06 06:40:32 fauxmo:55       DEBUG    Received message:
GET /setup.xml HTTP/1.1
Host: 192.168.0.173:56880
Accept: */*
Content-Type: application/json


2023-04-06 06:40:32 fauxmo:57       INFO     setup.xml requested by Echo
2023-04-06 06:40:32 fauxmo:103      DEBUG    Fauxmo response to setup request:
HTTP/1.1 200 OK
CONTENT-LENGTH: 943
CONTENT-TYPE: text/xml
DATE: Thu, 06 Apr 2023 05:40:32 GMT
LAST-MODIFIED: Sat, 01 Jan 2000 00:01:15 GMT
SERVER: Unspecified, UPnP/1.0, Unspecified
X-User-Agent: Fauxmo
CONNECTION: close

<?xml version="1.0"?><root><specVersion><major>1</major><minor>0</minor></specVersion><device><deviceType>urn:Belkin:device:controllee:1</deviceType><friendlyName>foo</friendlyName><manufacturer>Belkin International Inc.</manufacturer><modelName>Emulated Socket</modelName><modelNumber>3.1415</modelNumber><UDN>uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f</UDN><serviceList><service><serviceType>urn:Belkin:service:basicevent:1</serviceType><serviceId>urn:Belkin:serviceId:basicevent1</serviceId><controlURL>/upnp/control/basicevent1</controlURL><eventSubURL>/upnp/event/basicevent1</eventSubURL><SCPDURL>/eventservice.xml</SCPDURL></service><service><serviceType>urn:Belkin:service:metainfo:1</serviceType><serviceId>urn:Belkin:serviceId:metainfo1</serviceId><controlURL>/upnp/control/metainfo1</controlURL><eventSubURL>/upnp/event/metainfo1</eventSubURL><SCPDURL>/metainfoservice.xml</SCPDURL></service></serviceList></device></root>
2023-04-06 06:40:32 asyncio:166      DEBUG    <Server sockets=(<asyncio.TransportSocket fd=8, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.0.173', 56880)>,)> got a new connection from ('192.168.0.102', 54291): <socket.socket fd=12, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.0.173', 56880), raddr=('192.168.0.102', 54291)>
2023-04-06 06:40:32 fauxmo:43       DEBUG    Connection made with: ('192.168.0.102', 54291)
2023-04-06 06:40:32 fauxmo:55       DEBUG    Received message:
POST /upnp/control/basicevent1 HTTP/1.1
Host: 192.168.0.173:56880
Content-Type: text/xml; charset="utf-8"
SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState"
Content-Length: 298

<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"><BinaryState>1</BinaryState></u:GetBinaryState></s:Body></s:Envelope>
2023-04-06 06:40:32 fauxmo:66       INFO     request BasicEvent1
2023-04-06 06:40:32 fauxmo:114      DEBUG    Handling action for plugin type MQTTPlugin(on_cmd='button', on_value='on', off_cmd='button', off_value='off', state_cmd='button', status='unknown', _subscribed=True, client=<paho.mqtt.client.Client object at 0xffff8cc6f1c0>, _name='foo', _port=56880, _latest_action='off')
2023-04-06 06:40:32 fauxmo:140      INFO     Attempting to get state for foo
2023-04-06 06:40:32 fauxmo:146      INFO     foo state: unknown
2023-04-06 06:40:32 fauxmo:188      WARNING  Unable to complete command for foo:
POST /upnp/control/basicevent1 HTTP/1.1
Host: 192.168.0.173:56880
Content-Type: text/xml; charset="utf-8"
SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState"
Content-Length: 298

<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"><BinaryState>1</BinaryState></u:GetBinaryState></s:Body></s:Envelope>
2023-04-06 06:40:32 asyncio:166      DEBUG    <Server sockets=(<asyncio.TransportSocket fd=8, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.0.173', 56880)>,)> got a new connection from ('192.168.0.127', 59742): <socket.socket fd=12, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.0.173', 56880), raddr=('192.168.0.127', 59742)>
2023-04-06 06:40:32 fauxmo:43       DEBUG    Connection made with: ('192.168.0.127', 59742)
2023-04-06 06:40:32 fauxmo:55       DEBUG    Received message:
GET /setup.xml HTTP/1.1
Host: 192.168.0.173:56880
Accept: */*
Content-Type: application/json


2023-04-06 06:40:32 fauxmo:57       INFO     setup.xml requested by Echo
2023-04-06 06:40:32 fauxmo:103      DEBUG    Fauxmo response to setup request:
HTTP/1.1 200 OK
CONTENT-LENGTH: 943
CONTENT-TYPE: text/xml
DATE: Thu, 06 Apr 2023 05:40:32 GMT
LAST-MODIFIED: Sat, 01 Jan 2000 00:01:15 GMT
SERVER: Unspecified, UPnP/1.0, Unspecified
X-User-Agent: Fauxmo
CONNECTION: close

<?xml version="1.0"?><root><specVersion><major>1</major><minor>0</minor></specVersion><device><deviceType>urn:Belkin:device:controllee:1</deviceType><friendlyName>foo</friendlyName><manufacturer>Belkin International Inc.</manufacturer><modelName>Emulated Socket</modelName><modelNumber>3.1415</modelNumber><UDN>uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f</UDN><serviceList><service><serviceType>urn:Belkin:service:basicevent:1</serviceType><serviceId>urn:Belkin:serviceId:basicevent1</serviceId><controlURL>/upnp/control/basicevent1</controlURL><eventSubURL>/upnp/event/basicevent1</eventSubURL><SCPDURL>/eventservice.xml</SCPDURL></service><service><serviceType>urn:Belkin:service:metainfo:1</serviceType><serviceId>urn:Belkin:serviceId:metainfo1</serviceId><controlURL>/upnp/control/metainfo1</controlURL><eventSubURL>/upnp/event/metainfo1</eventSubURL><SCPDURL>/metainfoservice.xml</SCPDURL></service></serviceList></device></root>
2023-04-06 06:40:32 asyncio:166      DEBUG    <Server sockets=(<asyncio.TransportSocket fd=8, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.0.173', 56880)>,)> got a new connection from ('192.168.0.127', 59744): <socket.socket fd=12, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.0.173', 56880), raddr=('192.168.0.127', 59744)>
2023-04-06 06:40:32 fauxmo:344      DEBUG    Received data below from ('192.168.0.165', 50000):
2023-04-06 06:40:32 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: ssdp:all
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:32 fauxmo:43       DEBUG    Connection made with: ('192.168.0.127', 59744)
2023-04-06 06:40:32 fauxmo:420      DEBUG    Sending response to ('192.168.0.165', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:32 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: 28c6c11e-746f-4e9b-9800-1005638ab45a\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: ssdp:all\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::ssdp:all\r\n\r\n'
2023-04-06 06:40:32 fauxmo:344      DEBUG    Received data below from ('192.168.0.165', 50000):
2023-04-06 06:40:32 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: upnp:rootdevice
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:32 fauxmo:420      DEBUG    Sending response to ('192.168.0.165', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:32 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: 0f09dbe4-7755-4b90-be32-629d7b625f4b\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: upnp:rootdevice\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::upnp:rootdevice\r\n\r\n'
2023-04-06 06:40:32 fauxmo:55       DEBUG    Received message:
POST /upnp/control/basicevent1 HTTP/1.1
Host: 192.168.0.173:56880
Content-Type: text/xml; charset="utf-8"
SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState"
Content-Length: 298

<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"><BinaryState>1</BinaryState></u:GetBinaryState></s:Body></s:Envelope>
2023-04-06 06:40:32 fauxmo:66       INFO     request BasicEvent1
2023-04-06 06:40:32 fauxmo:114      DEBUG    Handling action for plugin type MQTTPlugin(on_cmd='button', on_value='on', off_cmd='button', off_value='off', state_cmd='button', status='unknown', _subscribed=True, client=<paho.mqtt.client.Client object at 0xffff8cc6f1c0>, _name='foo', _port=56880, _latest_action='off')
2023-04-06 06:40:32 fauxmo:140      INFO     Attempting to get state for foo
2023-04-06 06:40:32 fauxmo:146      INFO     foo state: unknown
2023-04-06 06:40:32 fauxmo:188      WARNING  Unable to complete command for foo:
POST /upnp/control/basicevent1 HTTP/1.1
Host: 192.168.0.173:56880
Content-Type: text/xml; charset="utf-8"
SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState"
Content-Length: 298

<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"><BinaryState>1</BinaryState></u:GetBinaryState></s:Body></s:Envelope>
2023-04-06 06:40:33 asyncio:166      DEBUG    <Server sockets=(<asyncio.TransportSocket fd=8, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.0.173', 56880)>,)> got a new connection from ('192.168.0.165', 49863): <socket.socket fd=12, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.0.173', 56880), raddr=('192.168.0.165', 49863)>
2023-04-06 06:40:33 fauxmo:43       DEBUG    Connection made with: ('192.168.0.165', 49863)
2023-04-06 06:40:33 fauxmo:55       DEBUG    Received message:
GET /setup.xml HTTP/1.1
Host: 192.168.0.173:56880
Accept: */*
Content-Type: application/json


2023-04-06 06:40:33 fauxmo:57       INFO     setup.xml requested by Echo
2023-04-06 06:40:33 fauxmo:103      DEBUG    Fauxmo response to setup request:
HTTP/1.1 200 OK
CONTENT-LENGTH: 943
CONTENT-TYPE: text/xml
DATE: Thu, 06 Apr 2023 05:40:33 GMT
LAST-MODIFIED: Sat, 01 Jan 2000 00:01:15 GMT
SERVER: Unspecified, UPnP/1.0, Unspecified
X-User-Agent: Fauxmo
CONNECTION: close

<?xml version="1.0"?><root><specVersion><major>1</major><minor>0</minor></specVersion><device><deviceType>urn:Belkin:device:controllee:1</deviceType><friendlyName>foo</friendlyName><manufacturer>Belkin International Inc.</manufacturer><modelName>Emulated Socket</modelName><modelNumber>3.1415</modelNumber><UDN>uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f</UDN><serviceList><service><serviceType>urn:Belkin:service:basicevent:1</serviceType><serviceId>urn:Belkin:serviceId:basicevent1</serviceId><controlURL>/upnp/control/basicevent1</controlURL><eventSubURL>/upnp/event/basicevent1</eventSubURL><SCPDURL>/eventservice.xml</SCPDURL></service><service><serviceType>urn:Belkin:service:metainfo:1</serviceType><serviceId>urn:Belkin:serviceId:metainfo1</serviceId><controlURL>/upnp/control/metainfo1</controlURL><eventSubURL>/upnp/event/metainfo1</eventSubURL><SCPDURL>/metainfoservice.xml</SCPDURL></service></serviceList></device></root>
2023-04-06 06:40:33 asyncio:166      DEBUG    <Server sockets=(<asyncio.TransportSocket fd=8, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.0.173', 56880)>,)> got a new connection from ('192.168.0.165', 49865): <socket.socket fd=12, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.0.173', 56880), raddr=('192.168.0.165', 49865)>
2023-04-06 06:40:33 fauxmo:43       DEBUG    Connection made with: ('192.168.0.165', 49865)
2023-04-06 06:40:33 fauxmo:55       DEBUG    Received message:
POST /upnp/control/basicevent1 HTTP/1.1
Host: 192.168.0.173:56880
Content-Type: text/xml; charset="utf-8"
SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState"
Content-Length: 298

<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"><BinaryState>1</BinaryState></u:GetBinaryState></s:Body></s:Envelope>
2023-04-06 06:40:33 fauxmo:66       INFO     request BasicEvent1
2023-04-06 06:40:33 fauxmo:114      DEBUG    Handling action for plugin type MQTTPlugin(on_cmd='button', on_value='on', off_cmd='button', off_value='off', state_cmd='button', status='unknown', _subscribed=True, client=<paho.mqtt.client.Client object at 0xffff8cc6f1c0>, _name='foo', _port=56880, _latest_action='off')
2023-04-06 06:40:33 fauxmo:140      INFO     Attempting to get state for foo
2023-04-06 06:40:33 fauxmo:146      INFO     foo state: unknown
2023-04-06 06:40:33 fauxmo:188      WARNING  Unable to complete command for foo:
POST /upnp/control/basicevent1 HTTP/1.1
Host: 192.168.0.173:56880
Content-Type: text/xml; charset="utf-8"
SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState"
Content-Length: 298

<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"><BinaryState>1</BinaryState></u:GetBinaryState></s:Body></s:Envelope>
2023-04-06 06:40:33 asyncio:166      DEBUG    <Server sockets=(<asyncio.TransportSocket fd=8, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.0.173', 56880)>,)> got a new connection from ('192.168.0.43', 34170): <socket.socket fd=12, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.0.173', 56880), raddr=('192.168.0.43', 34170)>
2023-04-06 06:40:33 fauxmo:43       DEBUG    Connection made with: ('192.168.0.43', 34170)
2023-04-06 06:40:33 fauxmo:55       DEBUG    Received message:
GET /setup.xml HTTP/1.1
Host: 192.168.0.173:56880
Accept: */*
Content-Type: application/json


2023-04-06 06:40:33 fauxmo:57       INFO     setup.xml requested by Echo
2023-04-06 06:40:33 fauxmo:103      DEBUG    Fauxmo response to setup request:
HTTP/1.1 200 OK
CONTENT-LENGTH: 943
CONTENT-TYPE: text/xml
DATE: Thu, 06 Apr 2023 05:40:33 GMT
LAST-MODIFIED: Sat, 01 Jan 2000 00:01:15 GMT
SERVER: Unspecified, UPnP/1.0, Unspecified
X-User-Agent: Fauxmo
CONNECTION: close

<?xml version="1.0"?><root><specVersion><major>1</major><minor>0</minor></specVersion><device><deviceType>urn:Belkin:device:controllee:1</deviceType><friendlyName>foo</friendlyName><manufacturer>Belkin International Inc.</manufacturer><modelName>Emulated Socket</modelName><modelNumber>3.1415</modelNumber><UDN>uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f</UDN><serviceList><service><serviceType>urn:Belkin:service:basicevent:1</serviceType><serviceId>urn:Belkin:serviceId:basicevent1</serviceId><controlURL>/upnp/control/basicevent1</controlURL><eventSubURL>/upnp/event/basicevent1</eventSubURL><SCPDURL>/eventservice.xml</SCPDURL></service><service><serviceType>urn:Belkin:service:metainfo:1</serviceType><serviceId>urn:Belkin:serviceId:metainfo1</serviceId><controlURL>/upnp/control/metainfo1</controlURL><eventSubURL>/upnp/event/metainfo1</eventSubURL><SCPDURL>/metainfoservice.xml</SCPDURL></service></serviceList></device></root>
2023-04-06 06:40:33 asyncio:166      DEBUG    <Server sockets=(<asyncio.TransportSocket fd=8, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.0.173', 56880)>,)> got a new connection from ('192.168.0.43', 34173): <socket.socket fd=12, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.0.173', 56880), raddr=('192.168.0.43', 34173)>
2023-04-06 06:40:33 fauxmo:43       DEBUG    Connection made with: ('192.168.0.43', 34173)
2023-04-06 06:40:33 fauxmo:55       DEBUG    Received message:
POST /upnp/control/basicevent1 HTTP/1.1
Host: 192.168.0.173:56880
Content-Type: text/xml; charset="utf-8"
SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState"
Content-Length: 298

<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"><BinaryState>1</BinaryState></u:GetBinaryState></s:Body></s:Envelope>
2023-04-06 06:40:33 fauxmo:66       INFO     request BasicEvent1
2023-04-06 06:40:33 fauxmo:114      DEBUG    Handling action for plugin type MQTTPlugin(on_cmd='button', on_value='on', off_cmd='button', off_value='off', state_cmd='button', status='unknown', _subscribed=True, client=<paho.mqtt.client.Client object at 0xffff8cc6f1c0>, _name='foo', _port=56880, _latest_action='off')
2023-04-06 06:40:33 fauxmo:140      INFO     Attempting to get state for foo
2023-04-06 06:40:33 fauxmo:146      INFO     foo state: unknown
2023-04-06 06:40:33 fauxmo:188      WARNING  Unable to complete command for foo:
POST /upnp/control/basicevent1 HTTP/1.1
Host: 192.168.0.173:56880
Content-Type: text/xml; charset="utf-8"
SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState"
Content-Length: 298

<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"><BinaryState>1</BinaryState></u:GetBinaryState></s:Body></s:Envelope>
2023-04-06 06:40:34 asyncio:166      DEBUG    <Server sockets=(<asyncio.TransportSocket fd=8, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.0.173', 56880)>,)> got a new connection from ('192.168.0.8', 32915): <socket.socket fd=12, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.0.173', 56880), raddr=('192.168.0.8', 32915)>
2023-04-06 06:40:34 fauxmo:43       DEBUG    Connection made with: ('192.168.0.8', 32915)
2023-04-06 06:40:34 fauxmo:55       DEBUG    Received message:
GET /setup.xml HTTP/1.1
Accept: */*
Host: 192.168.0.173:56880
Connection: close


2023-04-06 06:40:34 fauxmo:57       INFO     setup.xml requested by Echo
2023-04-06 06:40:34 fauxmo:103      DEBUG    Fauxmo response to setup request:
HTTP/1.1 200 OK
CONTENT-LENGTH: 943
CONTENT-TYPE: text/xml
DATE: Thu, 06 Apr 2023 05:40:34 GMT
LAST-MODIFIED: Sat, 01 Jan 2000 00:01:15 GMT
SERVER: Unspecified, UPnP/1.0, Unspecified
X-User-Agent: Fauxmo
CONNECTION: close

<?xml version="1.0"?><root><specVersion><major>1</major><minor>0</minor></specVersion><device><deviceType>urn:Belkin:device:controllee:1</deviceType><friendlyName>foo</friendlyName><manufacturer>Belkin International Inc.</manufacturer><modelName>Emulated Socket</modelName><modelNumber>3.1415</modelNumber><UDN>uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f</UDN><serviceList><service><serviceType>urn:Belkin:service:basicevent:1</serviceType><serviceId>urn:Belkin:serviceId:basicevent1</serviceId><controlURL>/upnp/control/basicevent1</controlURL><eventSubURL>/upnp/event/basicevent1</eventSubURL><SCPDURL>/eventservice.xml</SCPDURL></service><service><serviceType>urn:Belkin:service:metainfo:1</serviceType><serviceId>urn:Belkin:serviceId:metainfo1</serviceId><controlURL>/upnp/control/metainfo1</controlURL><eventSubURL>/upnp/event/metainfo1</eventSubURL><SCPDURL>/metainfoservice.xml</SCPDURL></service></serviceList></device></root>
2023-04-06 06:40:34 asyncio:166      DEBUG    <Server sockets=(<asyncio.TransportSocket fd=8, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.0.173', 56880)>,)> got a new connection from ('192.168.0.101', 47774): <socket.socket fd=12, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.0.173', 56880), raddr=('192.168.0.101', 47774)>
2023-04-06 06:40:34 fauxmo:43       DEBUG    Connection made with: ('192.168.0.101', 47774)
2023-04-06 06:40:34 fauxmo:55       DEBUG    Received message:
GET /setup.xml HTTP/1.1
Host: 192.168.0.173:56880
Accept: */*
Content-Type: application/json


2023-04-06 06:40:34 fauxmo:57       INFO     setup.xml requested by Echo
2023-04-06 06:40:34 fauxmo:103      DEBUG    Fauxmo response to setup request:
HTTP/1.1 200 OK
CONTENT-LENGTH: 943
CONTENT-TYPE: text/xml
DATE: Thu, 06 Apr 2023 05:40:34 GMT
LAST-MODIFIED: Sat, 01 Jan 2000 00:01:15 GMT
SERVER: Unspecified, UPnP/1.0, Unspecified
X-User-Agent: Fauxmo
CONNECTION: close

<?xml version="1.0"?><root><specVersion><major>1</major><minor>0</minor></specVersion><device><deviceType>urn:Belkin:device:controllee:1</deviceType><friendlyName>foo</friendlyName><manufacturer>Belkin International Inc.</manufacturer><modelName>Emulated Socket</modelName><modelNumber>3.1415</modelNumber><UDN>uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f</UDN><serviceList><service><serviceType>urn:Belkin:service:basicevent:1</serviceType><serviceId>urn:Belkin:serviceId:basicevent1</serviceId><controlURL>/upnp/control/basicevent1</controlURL><eventSubURL>/upnp/event/basicevent1</eventSubURL><SCPDURL>/eventservice.xml</SCPDURL></service><service><serviceType>urn:Belkin:service:metainfo:1</serviceType><serviceId>urn:Belkin:serviceId:metainfo1</serviceId><controlURL>/upnp/control/metainfo1</controlURL><eventSubURL>/upnp/event/metainfo1</eventSubURL><SCPDURL>/metainfoservice.xml</SCPDURL></service></serviceList></device></root>
2023-04-06 06:40:34 asyncio:166      DEBUG    <Server sockets=(<asyncio.TransportSocket fd=8, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.0.173', 56880)>,)> got a new connection from ('192.168.0.101', 47775): <socket.socket fd=12, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.0.173', 56880), raddr=('192.168.0.101', 47775)>
2023-04-06 06:40:34 fauxmo:43       DEBUG    Connection made with: ('192.168.0.101', 47775)
2023-04-06 06:40:34 fauxmo:55       DEBUG    Received message:
POST /upnp/control/basicevent1 HTTP/1.1
Host: 192.168.0.173:56880
Content-Type: text/xml; charset="utf-8"
SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState"
Content-Length: 298

<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"><BinaryState>1</BinaryState></u:GetBinaryState></s:Body></s:Envelope>
2023-04-06 06:40:34 fauxmo:66       INFO     request BasicEvent1
2023-04-06 06:40:34 fauxmo:114      DEBUG    Handling action for plugin type MQTTPlugin(on_cmd='button', on_value='on', off_cmd='button', off_value='off', state_cmd='button', status='unknown', _subscribed=True, client=<paho.mqtt.client.Client object at 0xffff8cc6f1c0>, _name='foo', _port=56880, _latest_action='off')
2023-04-06 06:40:34 fauxmo:140      INFO     Attempting to get state for foo
2023-04-06 06:40:34 fauxmo:146      INFO     foo state: unknown
2023-04-06 06:40:34 fauxmo:188      WARNING  Unable to complete command for foo:
POST /upnp/control/basicevent1 HTTP/1.1
Host: 192.168.0.173:56880
Content-Type: text/xml; charset="utf-8"
SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState"
Content-Length: 298

<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"><BinaryState>1</BinaryState></u:GetBinaryState></s:Body></s:Envelope>
2023-04-06 06:40:35 asyncio:166      DEBUG    <Server sockets=(<asyncio.TransportSocket fd=8, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.0.173', 56880)>,)> got a new connection from ('192.168.0.105', 52025): <socket.socket fd=12, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.0.173', 56880), raddr=('192.168.0.105', 52025)>
2023-04-06 06:40:35 fauxmo:43       DEBUG    Connection made with: ('192.168.0.105', 52025)
2023-04-06 06:40:35 fauxmo:55       DEBUG    Received message:
GET /setup.xml HTTP/1.1
Host: 192.168.0.173:56880
Accept: */*
Content-Type: application/json


2023-04-06 06:40:35 fauxmo:57       INFO     setup.xml requested by Echo
2023-04-06 06:40:35 fauxmo:103      DEBUG    Fauxmo response to setup request:
HTTP/1.1 200 OK
CONTENT-LENGTH: 943
CONTENT-TYPE: text/xml
DATE: Thu, 06 Apr 2023 05:40:35 GMT
LAST-MODIFIED: Sat, 01 Jan 2000 00:01:15 GMT
SERVER: Unspecified, UPnP/1.0, Unspecified
X-User-Agent: Fauxmo
CONNECTION: close

<?xml version="1.0"?><root><specVersion><major>1</major><minor>0</minor></specVersion><device><deviceType>urn:Belkin:device:controllee:1</deviceType><friendlyName>foo</friendlyName><manufacturer>Belkin International Inc.</manufacturer><modelName>Emulated Socket</modelName><modelNumber>3.1415</modelNumber><UDN>uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f</UDN><serviceList><service><serviceType>urn:Belkin:service:basicevent:1</serviceType><serviceId>urn:Belkin:serviceId:basicevent1</serviceId><controlURL>/upnp/control/basicevent1</controlURL><eventSubURL>/upnp/event/basicevent1</eventSubURL><SCPDURL>/eventservice.xml</SCPDURL></service><service><serviceType>urn:Belkin:service:metainfo:1</serviceType><serviceId>urn:Belkin:serviceId:metainfo1</serviceId><controlURL>/upnp/control/metainfo1</controlURL><eventSubURL>/upnp/event/metainfo1</eventSubURL><SCPDURL>/metainfoservice.xml</SCPDURL></service></serviceList></device></root>
2023-04-06 06:40:35 asyncio:166      DEBUG    <Server sockets=(<asyncio.TransportSocket fd=8, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.0.173', 56880)>,)> got a new connection from ('192.168.0.105', 52026): <socket.socket fd=12, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.0.173', 56880), raddr=('192.168.0.105', 52026)>
2023-04-06 06:40:35 fauxmo:43       DEBUG    Connection made with: ('192.168.0.105', 52026)
2023-04-06 06:40:35 fauxmo:55       DEBUG    Received message:
POST /upnp/control/basicevent1 HTTP/1.1
Host: 192.168.0.173:56880
Content-Type: text/xml; charset="utf-8"
SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState"
Content-Length: 298

<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"><BinaryState>1</BinaryState></u:GetBinaryState></s:Body></s:Envelope>
2023-04-06 06:40:35 fauxmo:66       INFO     request BasicEvent1
2023-04-06 06:40:35 fauxmo:114      DEBUG    Handling action for plugin type MQTTPlugin(on_cmd='button', on_value='on', off_cmd='button', off_value='off', state_cmd='button', status='unknown', _subscribed=True, client=<paho.mqtt.client.Client object at 0xffff8cc6f1c0>, _name='foo', _port=56880, _latest_action='off')
2023-04-06 06:40:35 fauxmo:140      INFO     Attempting to get state for foo
2023-04-06 06:40:35 fauxmo:146      INFO     foo state: unknown
2023-04-06 06:40:35 fauxmo:188      WARNING  Unable to complete command for foo:
POST /upnp/control/basicevent1 HTTP/1.1
Host: 192.168.0.173:56880
Content-Type: text/xml; charset="utf-8"
SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState"
Content-Length: 298

<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"><BinaryState>1</BinaryState></u:GetBinaryState></s:Body></s:Envelope>
2023-04-06 06:40:35 fauxmo:344      DEBUG    Received data below from ('192.168.0.43', 50000):
2023-04-06 06:40:35 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: ssdp:all
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:35 fauxmo:420      DEBUG    Sending response to ('192.168.0.43', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:35 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: cd19444f-0f37-4829-b8e7-9fe7b510e369\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: ssdp:all\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::ssdp:all\r\n\r\n'
2023-04-06 06:40:35 fauxmo:344      DEBUG    Received data below from ('192.168.0.43', 50000):
2023-04-06 06:40:35 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: upnp:rootdevice
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:35 fauxmo:420      DEBUG    Sending response to ('192.168.0.43', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:35 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: e002f2da-2e56-415b-8929-6d83d9e4a2f5\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: upnp:rootdevice\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::upnp:rootdevice\r\n\r\n'
2023-04-06 06:40:35 fauxmo:344      DEBUG    Received data below from ('192.168.0.102', 50000):
2023-04-06 06:40:35 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: ssdp:all
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:35 fauxmo:420      DEBUG    Sending response to ('192.168.0.102', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:35 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: b94e2616-7ab7-4b73-b3f1-9df51c7190be\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: ssdp:all\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::ssdp:all\r\n\r\n'
2023-04-06 06:40:35 fauxmo:344      DEBUG    Received data below from ('192.168.0.102', 50000):
2023-04-06 06:40:35 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: upnp:rootdevice
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:35 fauxmo:420      DEBUG    Sending response to ('192.168.0.102', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:35 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: 2f476710-76d9-4f2b-9e39-a025dce03ecf\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: upnp:rootdevice\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::upnp:rootdevice\r\n\r\n'
2023-04-06 06:40:35 fauxmo:344      DEBUG    Received data below from ('192.168.0.101', 50000):
2023-04-06 06:40:35 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: ssdp:all
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:35 fauxmo:420      DEBUG    Sending response to ('192.168.0.101', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:35 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: 5e60445b-7da6-447e-8dae-ef8f71d89cc6\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: ssdp:all\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::ssdp:all\r\n\r\n'
2023-04-06 06:40:35 fauxmo:344      DEBUG    Received data below from ('192.168.0.101', 50000):
2023-04-06 06:40:35 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: upnp:rootdevice
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:35 fauxmo:420      DEBUG    Sending response to ('192.168.0.101', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:35 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: b89480ed-5930-4c4d-a2ac-fedda676fdb5\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: upnp:rootdevice\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::upnp:rootdevice\r\n\r\n'
2023-04-06 06:40:35 fauxmo:344      DEBUG    Received data below from ('192.168.0.127', 50000):
2023-04-06 06:40:35 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: ssdp:all
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:35 fauxmo:420      DEBUG    Sending response to ('192.168.0.127', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:35 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: e037a10f-1fb6-4a81-a1f8-150a11c984fe\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: ssdp:all\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::ssdp:all\r\n\r\n'
2023-04-06 06:40:35 fauxmo:344      DEBUG    Received data below from ('192.168.0.127', 50000):
2023-04-06 06:40:35 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: upnp:rootdevice
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:35 fauxmo:420      DEBUG    Sending response to ('192.168.0.127', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:35 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: 363f84a6-b323-424d-a907-7b601dc4356f\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: upnp:rootdevice\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::upnp:rootdevice\r\n\r\n'
2023-04-06 06:40:35 fauxmo:344      DEBUG    Received data below from ('192.168.0.105', 50000):
2023-04-06 06:40:35 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: ssdp:all
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:35 fauxmo:420      DEBUG    Sending response to ('192.168.0.105', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:35 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: f6397619-5e7c-4f88-a6b6-e2c148e89eb1\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: ssdp:all\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::ssdp:all\r\n\r\n'
2023-04-06 06:40:35 fauxmo:344      DEBUG    Received data below from ('192.168.0.105', 50000):
2023-04-06 06:40:35 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: upnp:rootdevice
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:35 fauxmo:420      DEBUG    Sending response to ('192.168.0.105', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:35 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: 1a0ec6f9-d37d-4252-a942-37a523c15da0\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: upnp:rootdevice\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::upnp:rootdevice\r\n\r\n'
2023-04-06 06:40:35 fauxmo:344      DEBUG    Received data below from ('192.168.0.165', 50000):
2023-04-06 06:40:35 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: ssdp:all
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:35 fauxmo:420      DEBUG    Sending response to ('192.168.0.165', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:35 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: cbdfe0ef-9a63-4d68-aa12-b179e7dc1d0a\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: ssdp:all\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::ssdp:all\r\n\r\n'
2023-04-06 06:40:35 fauxmo:344      DEBUG    Received data below from ('192.168.0.165', 50000):
2023-04-06 06:40:35 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: upnp:rootdevice
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:35 fauxmo:420      DEBUG    Sending response to ('192.168.0.165', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:35 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: 6aeacc4d-0533-4bdc-8065-8c009ff3f9af\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: upnp:rootdevice\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::upnp:rootdevice\r\n\r\n'
2023-04-06 06:40:38 fauxmo:344      DEBUG    Received data below from ('192.168.0.43', 50000):
2023-04-06 06:40:38 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: ssdp:all
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:38 fauxmo:420      DEBUG    Sending response to ('192.168.0.43', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:38 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: 3e4186e7-e9f0-43eb-a751-70c2eebecb13\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: ssdp:all\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::ssdp:all\r\n\r\n'
2023-04-06 06:40:38 fauxmo:344      DEBUG    Received data below from ('192.168.0.43', 50000):
2023-04-06 06:40:38 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: upnp:rootdevice
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:38 fauxmo:420      DEBUG    Sending response to ('192.168.0.43', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:38 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: 95a20d1b-94c1-477f-9bb1-c78a53820bb6\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: upnp:rootdevice\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::upnp:rootdevice\r\n\r\n'
2023-04-06 06:40:38 fauxmo:344      DEBUG    Received data below from ('192.168.0.102', 50000):
2023-04-06 06:40:38 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: ssdp:all
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:38 fauxmo:420      DEBUG    Sending response to ('192.168.0.102', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:38 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: d2506f49-6860-4ac5-89ea-a1bfb506c1c1\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: ssdp:all\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::ssdp:all\r\n\r\n'
2023-04-06 06:40:38 fauxmo:344      DEBUG    Received data below from ('192.168.0.102', 50000):
2023-04-06 06:40:38 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: upnp:rootdevice
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:38 fauxmo:420      DEBUG    Sending response to ('192.168.0.102', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:38 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: 7eb8b337-835e-45d2-ac49-724713debd8e\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: upnp:rootdevice\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::upnp:rootdevice\r\n\r\n'
2023-04-06 06:40:38 fauxmo:344      DEBUG    Received data below from ('192.168.0.101', 50000):
2023-04-06 06:40:38 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: ssdp:all
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:38 fauxmo:420      DEBUG    Sending response to ('192.168.0.101', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:38 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: 0731570c-8eb8-4a1d-b940-c0c492aa2de6\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: ssdp:all\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::ssdp:all\r\n\r\n'
2023-04-06 06:40:38 fauxmo:344      DEBUG    Received data below from ('192.168.0.101', 50000):
2023-04-06 06:40:38 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: upnp:rootdevice
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:38 fauxmo:420      DEBUG    Sending response to ('192.168.0.101', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:38 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: 8685c802-3151-4ce4-892b-6f23e5247b7a\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: upnp:rootdevice\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::upnp:rootdevice\r\n\r\n'
2023-04-06 06:40:38 fauxmo:344      DEBUG    Received data below from ('192.168.0.105', 50000):
2023-04-06 06:40:38 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: ssdp:all
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:38 fauxmo:420      DEBUG    Sending response to ('192.168.0.105', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:38 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: 786bd388-8f07-4d48-98e6-3db2bd71145d\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: ssdp:all\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::ssdp:all\r\n\r\n'
2023-04-06 06:40:38 fauxmo:344      DEBUG    Received data below from ('192.168.0.105', 50000):
2023-04-06 06:40:38 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: upnp:rootdevice
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:38 fauxmo:420      DEBUG    Sending response to ('192.168.0.105', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:38 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: fcf0aaa1-7e53-4a55-8297-c0bf9e2ebf91\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: upnp:rootdevice\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::upnp:rootdevice\r\n\r\n'
2023-04-06 06:40:38 fauxmo:344      DEBUG    Received data below from ('192.168.0.127', 50000):
2023-04-06 06:40:38 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: ssdp:all
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:38 fauxmo:420      DEBUG    Sending response to ('192.168.0.127', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:38 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: ca4be3d0-789c-4aa1-8987-97b7d8e50a9e\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: ssdp:all\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::ssdp:all\r\n\r\n'
2023-04-06 06:40:38 fauxmo:344      DEBUG    Received data below from ('192.168.0.127', 50000):
2023-04-06 06:40:38 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: upnp:rootdevice
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:38 fauxmo:420      DEBUG    Sending response to ('192.168.0.127', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:38 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: ee6defbc-034b-4e17-8d87-2171b3e40114\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: upnp:rootdevice\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::upnp:rootdevice\r\n\r\n'
2023-04-06 06:40:38 fauxmo:344      DEBUG    Received data below from ('192.168.0.165', 50000):
2023-04-06 06:40:38 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: ssdp:all
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:38 fauxmo:420      DEBUG    Sending response to ('192.168.0.165', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:38 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: 271e11c5-7e27-4bb4-ae46-d43a0ca39cdc\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: ssdp:all\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::ssdp:all\r\n\r\n'
2023-04-06 06:40:38 fauxmo:344      DEBUG    Received data below from ('192.168.0.165', 50000):
2023-04-06 06:40:38 fauxmo:345      DEBUG    M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
ST: upnp:rootdevice
MAN: "ssdp:discover"
MX: 3


2023-04-06 06:40:38 fauxmo:420      DEBUG    Sending response to ('192.168.0.165', 50000) with mx 3.0:
b'HTTP/1.1 200 OK\r\nCACHE-CONTROL: max-age=86400\r\nDATE: Thu, 06 Apr 2023 05:40:38 GMT\r\nEXT:\r\nLOCATION: http://192.168.0.173:56880/setup.xml\r\nOPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01\r\n01-NLS: 72df45fd-2b72-4061-ba15-d5c72d371ccf\r\nSERVER: Fauxmo, UPnP/1.0, Unspecified\r\nST: upnp:rootdevice\r\nUSN: uuid:Socket-1_0-c3c8dbcd-8f60-3825-b42b-162fc311726f::upnp:rootdevice\r\n\r\n'

[WHYT](tried many different config files)


Please make sure you've taken these steps before submitting a new issue:

  • Try to reproduce the issue with Fauxmo installed in a
    venv
  • Ensure you're running a supported version of Python
    • Requires Python >= 3.2 for Fauxmo < 0.3.0
    • Requires Python >= 3.4.4 for Fauxmo >= 0.3.0
    • Requires Python >= 3.6.0 for Fauxmo >= 0.4.0
  • [x ] Run Fauxmo in debug mode (-vvv) and include relevant output
  • [x ] Include your Fauxmo config.json
  • [x ] Search the existing (including closed) issues
  • Please use codeblocks around your debug output and config

I should mention that the distro is Raspbian on "le Potato"
https://libre.computer/products/aml-s905x-cc/

here is part of the run with the -v

fauxmo -v
2023-04-06 19:24:53 fauxmo:188      WARNING  Unable to complete command for foo:
POST /upnp/control/basicevent1 HTTP/1.1
Host: 192.168.0.173:56880
Content-Type: text/xml; charset="utf-8"
SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState"
Content-Length: 298

<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"><BinaryState>1</BinaryState></u:GetBinaryState></s:Body></s:Envelope>
2023-04-06 19:24:53 fauxmo:188      WARNING  Unable to complete command for foo:
POST /upnp/control/basicevent1 HTTP/1.1
Host: 192.168.0.173:56880
Content-Type: text/xml; charset="utf-8"
SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState"
Content-Length: 298

<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"><BinaryState>1</BinaryState></u:GetBinaryState></s:Body></s:Envelope>
2023-04-06 19:24:53 fauxmo:188      WARNING  Unable to complete command for foo:
POST /upnp/control/basicevent1 HTTP/1.1
Host: 192.168.0.173:56880
Content-Type: text/xml; charset="utf-8"
SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState"
Content-Length: 298

I put in a couple of prints to help find the problem. theprints are in mqttplugin.py

jim@home-broker:~ $ fauxmo -vv
2023-04-07 15:53:27 fauxmo:42       INFO     Fauxmo v0.6.0
2023-04-07 15:53:27 fauxmo:51       INFO     Using config: /etc/fauxmo/config.json
2023-04-07 15:53:27 fauxmo:135      INFO     Starting UDP server
2023-04-07 15:53:39 fauxmo:57       INFO     setup.xml requested by Echo
2023-04-07 15:53:39 fauxmo:66       INFO     request BasicEvent1
2023-04-07 15:53:39 fauxmo:140      INFO     Attempting to get state for big cat
state_cmd on
status  unknown
2023-04-07 15:53:39 fauxmo:146      INFO     big cat state: unknown
2023-04-07 15:53:39 fauxmo:188      WARNING  Unable to complete command for big cat:
POST /upnp/control/basicevent1 HTTP/1.1
Host: 192.168.0.176:56789
Content-Type: text/xml; charset="utf-8"
SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState"
Content-Length: 298

<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"><BinaryState>1</BinaryState></u:GetBinaryState></s:Body></s:Envelope>

the message is coming out here
protocols.py lineline 186

     if success:
            soap_message = soap_format(
                action=action, action_type=action_type, return_val=return_val
            )

            response = self.add_http_headers(soap_message)
            logger.debug(response)
            self.transport.write(response.encode())
        else:
            errmsg = (
                f"Unable to complete command for {self.plugin.name}:\n{msg}"
            )
            logger.warning(errmsg)

this is where success would get set True
protocols.py line 186
because success is False line 137

        if command_format("GetBinaryState").casefold() in msg.casefold():
            logger.info(f"Attempting to get state for {self.plugin.name}")

            action = "Get"
            action_type = "BinaryState"

            state = self.plugin.get_state().casefold()
            logger.info(f"{self.plugin.name} state: {state}")

            if state in ["off", "on"]:
                success = True
                return_val = str(int(state.lower() == "on"))

the call to mqttplugin get_state returns self.status which is "unknown" at this time

    def get_state(self) -> str:
        """Return the self.status attribute.

        `self.status` is set asynchronously in on_message, so it may not
        immediately reflect state changed.

        Returns:
            State if known, else "unknown".

        """
        if self.state_cmd is None:
            return "unknown"

        return self.status

Here is where self.status would get set. It is a mqtt callback which i find odd.
Why doing a fauxmo device discovery does mqttplugin need to talk to a device through the broker?
I would expect that it would only need to do the fauxmo stuff.
I would not expect on_message to be called by MQTT during discovery.
and it wasn't.
I expect the fix is to know you are doing a discovery and have get_state return an
valid self.status

def on_message(
        self, client: Client, userdata: str, message: MQTTMessage
    ) -> None:
        """Process an incoming message."""
        status = message.payload.decode("utf-8")

        if status == self.off_value:
            self.status = "off"
        elif status == self.on_value:
            self.status = "on"

@Perforex Are you still using this plugin? If so, have you seen any issues?

@jdodgen What version of paho are you using?

Why doing a fauxmo device discovery does mqttplugin need to talk to a device through the broker? I would expect that it would only need to do the fauxmo stuff.

I don't understand what you mean here. I think the whole point is to check the status of the device, not of fauxmo. If you're using mqtt as your transport, how else would it communicate with the device to determine the device state?

here is the version of paho.mqtt

The plugin specifies a different version, though I bet that's not the problem.

I just expected that during "device discovery" that all fauxmo would need
is the WeMo stuff name, port. on ,off, and status strings.
But I don't know why I would need an incoming MQTT message reply to be
discovered.

I'm not sure what you mean by an "incoming MQTT message reply." The Echo expects to be talking with a device, and as part of setup queries the status of that device. Fauxmo is just a fake proxy for that "device." In the case of the MQTT plugin, the Echo is going to ask about the status of the device via MQTT.

Fauxmo >>> MQTT Client 1 >>> broker >>> MQTT Client 2

This looks wrong to me. Fauxmo talks to the broker, not to the client. MQTT is not a device-to-device protocol, it always goes through the broker AFAIK.

Flow:

  • Echo "status?" >>> Fauxmo "status?" >>> MQTT broker "status!" >> Fauxmo "status!" >> Echo

I think your first step(s) in debugging will be to run something like mosquitto_sub -h 192.168.0.173 -t 'button' (not sure of the actual syntax) to make sure your MQTT calls are working. Can you verify that they are? If you're not able to manually confirm that the state_cmd works then the rest of this is probably an exercise in futility!

https://mosquitto.org/man/mosquitto_sub-1.html

My esp32-s2 based buttons are working fine with mqtt.

I don't think that's relevant though, I'm trying to help you verify that the connection between the device running fauxmo, the broker, and the topic providing data for state_cmd are all intact. Bonus points if you run the mosquitto_sub command from above with the same user that is running fauxmo.

It is using the same paho that is used by mqttplugin.

That doesn't seem to be true. Please review my link above, which shows the version the plugin author used / recommended. (To add additional confusion, the tests are running on a third version -- sorry, I should fix that.)

Again my problem is with the discovery (alexa discover devices) not with
the sending of on off or status requests.

Perhaps I don't understand your problem (the behavior you're concerned about) then.

Your initial post says:

always get the same error:
" WARNING Unable to complete command for foo:". When I have "Alexa discover devices" .

Your log says:

Attempting to get state for foo
INFO foo state: unknown
WARNING Unable to complete command for foo:

From what I see on_message will never be called. Because no topics have
been subscribed.

Based on your config above, state_cmd is not None, so it looks like subscription happens here. The tests suggest that the subscription works.

Here is my mosquitto publish

I was hoping for mosquitto_sub, not publish; based on what you're telling me, publish is working fine, right?

It looks like you have some responses buried in the replied content above (looks like you might have edited them in an email reply). Are you able to fix the formatting so I can find them? As is, it's hard to differentiate them from my content.

For example, this looks like a new response hidden in there:

I don't think so. on_connect is never called because the loop is never
started.

Why would the loop never be started? According to your config posted above, your state_cmd is not None:

if self.state_cmd is not None:

I sorry I thought I indicated that it WAS None.

You said that, but your config says otherwise: "state_cmd": "button"

# around line 129

Because Python is whitespace sensitive, I can't really interpret this codeblock unless you edit the post and fix it. I realize that email replies are convenient, but they are somewhat difficult to read!

If you'd like to truly test it, perhaps a good place to add a print statement would be right before and after if self.state_cmd is not None:; before you could put e.g. print(f"{self.state_cmd=}") and after put print("state_cmd was not None!"), then post a verbose debug log and see what happens.

My problem was the state_cmd IS required and should be optional, it is not a mqtt requirement.

I'm glad you got things working, but I disagree with your opinion here. I would argue that your MQTT device is not well suited to use with the Echo. This program is designed to work specifically for the Amazon Echo, and the Amazon Echo requires the ability to poll state. Having the plugin default to requiring an ability to poll state is completely reasonable, and imposing preferences for what do to in the absence of the ability to determine state would be over-opinionated, in my opinion ;)

EDIT: After posting, I realize I may just be misunderstanding the problem. After the initial discovery, does the subscription to the state then work? If so, I wonder if enabling retained message through MQTT is the best answer here.

I think your approach here is very reasonable for your use case, but is clearly a workaround.

That said, I think you've uncovered some new behavior that I need to account for. My recollection is that (previously) devices with unknown state would still get added.

I also had thought that one should be able to subscribe to the same MQTT topic -- perhaps with retained messages enabled -- and have a much more accurate accounting of the state, but I'm no expert here.

For additional context and the workaround for this situation that I've settled on for other plugins

I think you probably could have worked around the issue by subclassing MQTTPlugin and taking advantage of the use_fake_state logic, something like this (untested):

from fauxmo.plugins import FauxmoPlugin
from mqttplugin import MQTTPlugin

class CustomMQTTPlugin(MQTTPlugin):
    def get_state(self) -> str:
        return FauxmoPlugin.get_state(self)

But then again, perhaps that's the wrong answer.

So I think this change may be the culprit (at least in part), which you have been trying to bring to my attention (thank you).

I made this change a few years ago so that garbage responses wouldn't be interpreted as off, since the logic is return_val = str(int(state.lower() == "on")) (meaning that on -> on, and off -> off, but also garbage -> off). Maybe a change here would allow the discovery to succeed.

I've pushed a possible fix to the dev branch. Can you please install from the dev branch and let me know how it works?

I also added the use_fake_state option; if you have time and would be willing to also test this I would greatly appreciate it. Setting it to True should tell the Fauxmo device to ignore the subscribed channel completely and just return the last successful command (on or off). This is problematic if a device also has manual controls (gets out of sync if Fauxmo last succeed with on, but someone manually turned the switch off) but is a necessary workaround in some setups.

For my use I need some fault tolerance. The user may input an invalid or not operational yet broker address. Currently this crashes fauxmo. The fix is simple, just handle the exception and ignore. The reconnect logic in the "loop" will fix itself if and when the broker comes alive. I also trap the publish exception for the same reasons
Second thing is I need the loop thread running all the time to handle all the call backs, reconnects, and internal messages.
I am also working on adding QoS and retain options to the publish logic

Here are my current changes:

68c68
<     paho-mqtt==1.6.1
---
>     paho-mqtt==1.3.1
92a93,94
>         qos: int = 0,
>         retain: int = 0,
105,107c107,111
<             off_cmd: [ MQTT Queue, value to be publshed as str ] to turn off
<             on_cmd: [ MQTT Queue, value to be publshed as str ] to turn on
<             state_cmd: MQTT Queue to get state
---
>             off_cmd: [ MQTT topic, value to be publshed as str ] to turn off
>             on_cmd: [ MQTT topic, value to be publshed as str ] to turn on
>             state_cmd: MQTT Message to get state
>             qos: MQTT Quality of Service
>             retain: MQTT retain
111a116,118
>         self.default_state = "off"  # discovery needs a valid state, this gets set with on and off 
>         self.qos = qos
>         self.retain = retain
122c129,136
<         self.client.connect(mqtt_server, mqtt_port, 60)
---
>         try:
>             self.client.connect(mqtt_server, mqtt_port, 60)
>         except Exception as e:
>             print("connect failed", e) 
>             # this is not fatal for paho, just a warning 
>             # When broker comes alive it reconnects
>             # handled in the loop thread
>             # if it is not trapped it terminates fauxmo
126,128c140,144
<         # Looping thread only seems necessary for status updates
<         if self.state_cmd is not None:
<             self.client.loop_start()
---
>         self.client.loop_start() 
>         # this is needed for the on_* routines 
>         # as well as the other tasks like reconnect
>         # and mqtt handshakes
> 
159,160c175
<     def _publish(self, topic: str, value: str) -> bool:
<         msg = self.client.publish(topic, value)
---
>     def _publish(self, topic: str, value: str) -> bool: 
162,163c177,183
<             msg.wait_for_publish()
<         except ValueError:
---
>             msg = self.client.publish(topic, value, qos=0, retain=self.retain)
>             # qos other than 0 have not been implemented yet -- self.qos
>             try:
>                 msg.wait_for_publish()
>             except ValueError:
>                 return False
>         except:
173a194
>         self.default_state = "on"
183c204,205
<         return self._publish(self.off_cmd, self.off_value)
---
>         self.default_state = "off"
>         return self.publish(self.off_cmd, self.off_value)
193c215,219
< 
---
>         """
>         """
>         the following is a hack to handle when
>         it was crashing when no state needed
>         and a "Alexa discovery devices" is done 
196c222
<             return "unknown"
---
>             return self.default_state

I might be hitting the same issue, so I will comment here. I get this error (Unable to complete command):

main_1  | <?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"><BinaryState>1</BinaryState></u:GetBinaryState></s:Body></s:Envelope>
main_1  | 2023-07-03 15:53:38 fauxmo:188      WARNING  Unable to complete command for MQTT Study Light 1:
main_1  | POST /upnp/control/basicevent1 HTTP/1.1
main_1  | Host: 192.168.10.3:12349
main_1  | Content-Type: text/xml; charset="utf-8"
main_1  | SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState"
main_1  | Content-Length: 298
main_1  | 
main_1  | <?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"><BinaryState>1</BinaryState></u:GetBinaryState></s:Body></s:Envelope>

My config doesn't have the state command:

{
    "FAUXMO": {
        "ip_address": "auto"

    },
    "PLUGINS": {
        "MQTTPlugin": {
            "path": "mqttplugin.py",
            "DEVICES": [
                {
                    "port": 12349,
                    "on_cmd": [ "Home/Light/Study01", "1" ],
                    "off_cmd": [ "Home/Light/Study01", "0" ],
                    "name":"MQTT Study Light 1",
                    "mqtt_server": "192.168.10.100",
                    "mqtt_port": 1883
                },
                {
                    "port": 12350,
                    "on_cmd": [ "Home/Light/Study02", "1" ],
                    "off_cmd": [ "Home/Light/Study02", "0" ],
                    "name":"MQTT Study Light 2",
                    "mqtt_server": "192.168.10.100",
                    "mqtt_port": 1883
                },
                {
                    "port": 12351,
                    "on_cmd": [
                        "home-assistant/devices/cmnd/sonoff1/POWER",
                        "ON"
                    ],
                    "off_cmd": [
                        "home-assistant/devices/cmnd/sonoff1/POWER",
                        "OFF"
                    ],
                    "name":"Hass MQTT device",
                    "mqtt_server": "192.168.10.100",
                    "mqtt_port": 1883
                }
            ]
        }
    }
}

I'm not sure why I get that error (and discovery doesn't complete). I don't need state, I just need the devices to show up, really.

It looks like Alexa doesn't want to discover devices with an unknown status. Having the plugin always return on works great. Very odd.

@skorokithakis @jdodgen Fauxmo's dev branch now includes support for an initial_state parameter. If you find time to test it would be appreciated! Thanks to both for your feedback along the process.

I'll give it a shot and report back, thanks! Does this replace unknown with that initial state?

Thanks!

Yes, with the newest push to fauxmo-plugins the mqttplugin should initialize its status to that state.

Sorry to not get back. I have been busy with other stuff and travel.. Well today I got to the point where I could test out the "discover devices" and it worked like a champ.