Coder Social home page Coder Social logo

n8henrie / fauxmo-plugins Goto Github PK

View Code? Open in Web Editor NEW
14.0 3.0 13.0 109 KB

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

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

License: MIT License

Python 95.77% Makefile 4.23%
python3 home-automation amazon-echo echo

fauxmo-plugins's Introduction

fauxmo-plugins

master: master branch build status dev: dev branch build status

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

Introduction and Rationale

As of Fauxmo 0.4.0, I am splitting the plugins out of the main Fauxmo code. Plugins were previously referred to as handlers.

  • I've implemented a crude plugin import system that allows users to create and user their own plugins by inheriting from FauxmoPlugin and including the path to the file in their config.
  • This means I can remove dependencies from Fauxmo that some users may not use, and hopefully users unfamiliar with virtualenvs will quit breaking their installations due to my pinned versions.
  • I'll be able to update plugins without having to release a new version of Fauxmo core, keeping them in their own separate VCS silos.

Using plugins

Personal user plugins

The biggest motivation for the changes to Fauxmo 0.4.0 was to allow users to create Fauxmo plugins to scratch their own itch. There are only a few requirements to get started:

  • Your plugin will be class that inherits from the fauxmo.plugins.FauxmoPlugin ABC.
  • Your plugin will override the abstract methods on, off, and get_state, which will unsurprisingly be called when you tell Alexa to turn a Fauxmo device on or off, and when Alexa queries the device state. The on and off methods should return a bool that suggests whether they succeeded, and get_state should return "on", "off", or "unknown". If you have no way to query state, consider using a simple return "unknown" as your get_state method, or you can return super().get_state() to use the last successful command as the current state (e.g. of .on() succeeded, return "on"). Note that this behavior means that if you manually switch a device or change it with another program that your reported state will be incorrect.
  • Your plugin will be initialized if the exact (case sensitive) name is listed as a key under the PLUGINS section in your Fauxmo configuration (please see the Fauxmo docs for details), and if you include the path to the file that provides your plugin class as the path subkey.
  • Each device you plan to use with a plugin will be listed under the DEVICES key of your plugin.
  • Your plugin class will receive several kwargs on initialization, including the name and port that the Fauxmo device will use, as defined in your Fauxmo config. Hopefully this will allow users to implement some custom debugging / logging features.
  • If you want your plugin class to determine its own port in code or if you decide to override the __init__ method, you may need to do some combination of the following:
    • super().__init__(name=name, port=port) in your custom __init__.
    • Define the "private" self._port attribute.
    • Override the FauxmoPlugin.port() property.
  • If your plugin has external dependencies, I highly recommend that you include the version of the dependency in your module-level docstring, especially if you're going to publish your plugin as a Gist.

I will not be providing much support to users needing help with plugins. I'm an intermediate Pythonista at best, so if you are just learning about classes, inheritance, and abstract methods, please feel free to make a new issue for problems you encounter, but I might not be much help. On the other hand, if you're a more advanced Pythonista, feel free to make suggestions.

Plugins provided in the fauxmo-plugins repo

I'm going to include a few handy plugins here for reference. To use them in your Fauxmo installation, all you need to do is get a local copy of the file and include the path in your Fauxmo config as described above. You could do this a few ways:

  1. Clone the repo git clone https://github.com/n8henrie/fauxmo-plugins.git
  2. Use "path": "~/path/to/fauxmo-plugins/exampleplugin.py" in your config

Alternatively,

  1. Download the specific plugin you're interested in by clicking on the file in your web browser, clicking the Raw button, and using wget or curl to download the resulting file.
  2. Include the path to that file as the path for that plugin.

If you think your plugin would be good to include in the fauxmo-plugins repo, feel free to send me a pull request. To be merged:

  • Must by python 3.6+ compatible
  • Include a reasonable docstring that:
    • Explains the intended purpose, usage, and any required config variables.
    • Includes as pinned version numbers for any dependencies at the end.
  • The file should:
    • Include type annotations.
    • Pass mypy --ignore-missing-imports.
    • Pass flake8.

Additionally, I'd like to include a list of interesting plugins here in the README, even if the owners don't want to be included in this repo.

Pre-installed plugins

Fauxmo comes with few plugin classes already available in the fauxmo.plugins package. If you think your plugin would be good to include as one of these, send a PR to that repo. Please note that I would strongly prefer not to have any 3rd party / non-stdlib dependencies for the core Fauxmo package, in addition to the requirements for the fauxmo-plugin repo above.

Tests

Tests are highly recommended.

The modules are not installable, so you'll need to be able to import your class directly from the module file. This can be done by monkeypatching sys.path, but I prefer if you just use python3 -m pytest tests/ from the root directory, which will prompt Python to add it to PYTHONPATH, and should allow you to import your class: from myplugin import MyPlugin.

You may find the fauxmo_server pytest fixture helpful -- given the path to a config file as its only argument, it returns a context manager that is a Fauxmo instance using that config. Using this context manager and a small sample config, you can simulate receiving a "turn on" command from the Echo by posting '<BinaryState>1</BinaryState>' to the http://localhost:12345/upnp/control/basicevent1 endpoint, where localhost is your config's ["FAUXMO"]["ip_address"] and 12345 is the port for one of your plugin's Fauxmo device instances. See tests/test_restapiplugin.py and tests/test_restapiplugin_config.json for an example.

Alternatively, you can test your plugin directly without using the rest of the Fauxmo machinery by reading in your config and ensuring that e.g. YourPlugin(**device).on() works as intended (again, see tests/test_restapiplugin.py as an example).

NB: To facilitate simultaneous development between n8henrie/fauxmo and n8henrie/fauxmo-plugins, requirements-test.txt pulls the latest version of the dev branch of Fauxmo from GitHub; this is to help ensure that the automated CI tests can run if I am pushing out changes to both repos that are not yet ready to be merged into master or get pushed to PyPI. I suggest that if you're developing locally and need to make simultaneous PRs against Fauxmo and Fauxmo-plugins that you check out a separate branch in each and temporarily change the requirements-test.txt file to something like -e git+file:///abs/path/to/local/fauxmo/repo#egg=fauxmo.

Interesting Plugins (not included in this repo)

  • None yet. Why not be the first?

Troubleshooting / FAQ

See also: Fauxmo FAQ

fauxmo-plugins's People

Contributors

dependabot[bot] avatar flavio-fernandes avatar jdodgen avatar n8henrie avatar provokateurin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

fauxmo-plugins's Issues

MQTT plugin

I'm considering writing an MQTT plugin for fauxmo but before I start I'd like to understand how popular this requirement might be. It's popularity won't dictate whether I write the plugin, since I need it for my own use, but rather the care, testing and functionality that I include. For example I don't need features such as user authentication or QoS since I'm only using MQTT on my internal network and very low volume but if these are features useful to a lot of other people, I'll consider it during the design phase.

Though I haven't been a professional code writer for many years, having looked at the existing plugins and the guidelines I don't think it will be an onerous task.

I'd welcome all feedback on this proposal/suggestion.

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

  • 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

commandlineplugin, echo, single quotes... confused

I've done this before, but the SD card on my pi got corrupted, and guess who didn't make a backup of his configs. Anyway...

I'm trying to send commands to mochad to control x10 switches. I need to echo text to nc. I can manually run:

echo 'rf a1 on' | nc localhost 1099

...and it works.

I've put the following in my config.json:

"on_cmd": "echo 'rf a4 on' | nc localhost 1099",

...and it doesn't work. Alexa reports, "OK," but the lights do not change. Looking at the status of my fauxmo service, I see:

Aug 02 22:32:01 autopi fauxmo[6055]: rf a1 on | nc localhost 1099

Which is... confusing. If this is the result of the echo (it seems to be as the touch example doesn't put anything in the status), then why is it not just rf a1 on? If it's ignoring the single quotes, then why is it echoing anything at all?

I monitored mochad by running nc, but nothing goes to it. I also usually get alerts when mochad executes a command, but did not see any.

mqqt library missing

hello again :(

I am trying to set up the mqtt plug in but it doesn't work.
the other plugin is working fine
my config file has been tested OK
when I run the service (or whatever you call it), I got this error :

(.venv) pi@raspberrypi:~ $ fauxmo -c config3.json -vv
2019-08-30 23:51:16 fauxmo:41 INFO Fauxmo v0.4.9
Traceback (most recent call last):
File "/home/pi/.venv/lib/python3.7/site-packages/fauxmo/fauxmo.py", line 94, in main
module = importlib.import_module(modname)
File "/usr/lib/python3.7/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'fauxmo.plugins.mqttplugin'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/pi/.venv/bin/fauxmo", line 10, in
sys.exit(cli())
File "/home/pi/.venv/lib/python3.7/site-packages/fauxmo/cli.py", line 37, in cli
main(config_path_str=args.config, verbosity=verbosity)
File "/home/pi/.venv/lib/python3.7/site-packages/fauxmo/fauxmo.py", line 98, in main
module = module_from_file(modname, path_str)
File "/home/pi/.venv/lib/python3.7/site-packages/fauxmo/utils.py", line 76, in module_from_file
spec.loader.exec_module(module) # type: ignore
File "", line 728, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/pi/fauxmo-plugins/mqttplugin.py", line 73, in
from paho.mqtt.client import Client, MQTTMessage
ModuleNotFoundError: No module named 'paho'

I installed and tested OK mosquitto_client on the raspberry where fauxmo is running
I ran in some python code using paho.mqtt.client -> it's OK

what did I didn't check ?

thank you again

MQTTPlugin: "device doesn't support that" error

Operating system and version: Raspian 4.14.79-(RPi3)
Python version: 3.7.3
Fauxmo version (fauxmo --version): v0.5.0
Echo device type : Echo 2nd generation
Echo Firmware Version: 1.24.207453.0

my config.json is :

"FAUXMO": {
    "ip_address": "auto"
},
"PLUGINS": {
    "MQTTPlugin": {
      "path": "/home/pi/fauxmo-plugins/mqttplugin.py",
        "DEVICES": [
            {
                "port": 12349,
                "on_cmd": [ "raspmotecli", "BOSE,ON" ],
                "off_cmd": [ "raspmotecli", "BOSE,OFF" ],
                "state_cmd": "raspmotecli",
                "name":"BASE",
                "mqtt_server": "192.168.1.14",
                "mqtt_port": 1883
            }
        ]
    }

}

}

when detecting the device, everything works fine
when asking Alexa to turn "ON" or "OFF" the device BASE. Alexa answers "BASE doesn't support that".

what is very surprising is that when runninf fauxmo with -vvv nothing seems to be received from alexa regarding my order.

I noticed that when BASE is discovered its state is "unknown". here is what's produced :


<?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>
2020-05-18 00:12:52 fauxmo:66       INFO     request BasicEvent1
2020-05-18 00:12:52 fauxmo:114      DEBUG    Handling action for plugin type <fauxmo.plugins.mqttplugin.MQTTPlugin object at 0x76135df0>
2020-05-18 00:12:52 fauxmo:140      INFO     Attempting to get state for BASE
2020-05-18 00:12:52 fauxmo:146      INFO     BASE state: unknown
2020-05-18 00:12:52 fauxmo:188      WARNING  Unable to complete command for BASE:
POST /upnp/control/basicevent1 HTTP/1.1
SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState"
Content-Type: text/xml; charset="utf-8"
Accept:
User-Agent: Dalvik/2.1.0 (Linux; U; Android 5.1.1; AEORD Build/LVY48F)
Host: 192.168.1.26:12349
Connection: Keep-Alive
Accept-Encoding: gzip
Content-Length: 299

I read other tickets relard to those unknow state but couldn't find out anything that could help me.

thank you in any case for your work and your answer

The mqtt loop should probably always be running

If I don't run the loop (which I don't, because of state updates), I get "connection closed" errors a lot. I think the loop should run regardless, because I think that's where the keepalive code is.

I can submit a PR if you'd like.

commandlineplugin sample json file not found

I'm trying to run the sample json file for the commandlineplugin.py and I get
ls: cannot access 'testfile.txt': No such file or directory

So I tried to be more explicit with:
"on_cmd": "touch ~/testfile.txt",
"off_cmd": "rm ~/testfile.txt",
"state_cmd": "ls ~/testfile.txt"

touch: cannot touch '~/testfile.txt': No such file or directory
ls: cannot access '~/testfile.txt': No such file or directory

I can run both commands as the logged in user no problem. Do you know why this is happening? Is this a permissions issue or an issue with how the string is passed to subprocess.run?

unable to use get_state 'unknown' return with success.

Hi,
I'm trying to develop a new plugin but I'm getting error from Alexa when returing the new state.
I'm using:
return 'unknown'
As suggested but Alexa is saying that the device is not responding correctly.
The on() and off() methods are correctly called and they returns 'True'.

What I'm doing:
I've to simulate a button (press and release):
I need to set the relay state to on for few milliseconds then return the status to off (like a button not a switch) but I don't have any feedback/sensor to get the resulting state so I'm assuming it will be OK/Unkwown.

What happens
Anyhow setting the get_state() return to 'unkwon' makes Alexa unhappy: the task is performed but the response says that the device is unresponsive.

Expected:
returning true from on() and off() and 'unknown' from get_state I'm expecting everiting will be fine and Alexa should perform the task responding 'OK'.

Environment:
raspberry pi zero W + optoisolated 8ch relais + Alexa echo dot 2
$ fauxmo -V v0.4.9

Workaround:
Currently I'm returning on and off to simulate a state change, this is done to get an 'OK' response from the Alexa echo dot.

Unable to do discovery

Windows 10 Machine
Python 3.6.7
Fauxmo : 0.4.4

Please find below the verbose

(venv) C:\Users\310093198\AppData\Local\Programs\Python\Python36\venv\Scripts>fauxmo -c config.json -vvv
2017-11-12 12:27:30 fauxmo:37 INFO Fauxmo v0.4.4
2017-11-12 12:27:30 fauxmo:38 DEBUG 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)]
2017-11-12 12:27:30 fauxmo:37 DEBUG Using IP address: 192.168.1.33
2017-11-12 12:27:30 fauxmo:102 DEBUG plugin_vars: {}
2017-11-12 12:27:30 fauxmo:105 DEBUG device config: {'port': 12345, 'on_cmd': 'http://192.168.1.33:8000/get?switch=on', 'off_cmd': 'http://192.168.1.33:8000/get?switch=off', 'method': 'GET', 'name': 'fake switch one'}
2017-11-12 12:27:30 asyncio:1068 INFO <Server sockets=[<socket.socket fd=416, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.1.33', 12345)>]> is serving
2017-11-12 12:27:30 fauxmo:123 DEBUG Started fauxmo device: {'name': 'fake switch one', 'plugin': <fauxmo.plugins.simplehttpplugin.SimpleHTTPPlugin object at 0x0000029AA6276940>}
2017-11-12 12:27:30 fauxmo:105 DEBUG device config: {'port': 12346, 'on_cmd': 'http://127.0.0.1:8000/digest-auth/auth/fauxmouser/fauxmopass', 'off_cmd': 'http://127.0.0.1:8000/digest-auth/auth/fauxmouser/fauxmopass', 'user': 'fauxmouser', 'password': 'fauxmopass', 'name': 'fake Indigo switch'}
2017-11-12 12:27:30 asyncio:1068 INFO <Server sockets=[<socket.socket fd=780, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.1.33', 12346)>]> is serving
2017-11-12 12:27:30 fauxmo:123 DEBUG Started fauxmo device: {'name': 'fake Indigo switch', 'plugin': <fauxmo.plugins.simplehttpplugin.SimpleHTTPPlugin object at 0x0000029AA554C8D0>}
2017-11-12 12:27:30 fauxmo:105 DEBUG device config: {'port': 12347, 'on_cmd': 'http://192.168.1.33:8000/put', 'off_cmd': 'http://192.168.1.33:8000/put', 'on_data': {'isOn': 1}, 'off_data': {'isOn': 0}, 'method': 'PUT', 'name': 'fake Indigo switch'}
2017-11-12 12:27:30 asyncio:1068 INFO <Server sockets=[<socket.socket fd=640, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.1.33', 12347)>]> is serving
2017-11-12 12:27:30 fauxmo:123 DEBUG Started fauxmo device: {'name': 'fake Indigo switch', 'plugin': <fauxmo.plugins.simplehttpplugin.SimpleHTTPPlugin object at 0x0000029AA6331A20>}
2017-11-12 12:27:30 fauxmo:105 DEBUG device config: {'name': 'fake post request', 'port': 12348, 'on_cmd': 'http://192.168.1.33:8000/post', 'off_cmd': 'http://192.168.1.33:8000/post', 'method': 'POST', 'headers': {'x-ha-access': 'your_hass_password'}, 'on_data': {'entity_id': 'switch.fake_hass_switch'}, 'off_data': {'entity_id': 'switch.fake_hass_switch'}}
2017-11-12 12:27:30 asyncio:1068 INFO <Server sockets=[<socket.socket fd=812, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.1.33', 12348)>]> is serving
2017-11-12 12:27:30 fauxmo:123 DEBUG Started fauxmo device: {'name': 'fake post request', 'plugin': <fauxmo.plugins.simplehttpplugin.SimpleHTTPPlugin object at 0x0000029AA63319E8>}
2017-11-12 12:27:30 fauxmo:105 DEBUG device config: {'name': 'test https request', 'port': 12349, 'on_cmd': 'https://httpbin.org/post', 'off_cmd': 'https://httpbin.org/post', 'method': 'POST', 'headers': {'x-ha-access': 'your_hass_password'}, 'on_data': {'entity_id': 'switch.fake_hass_switch'}, 'off_data': {'entity_id': 'switch.fake_hass_switch'}}
2017-11-12 12:27:30 asyncio:1068 INFO <Server sockets=[<socket.socket fd=816, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.1.33', 12349)>]> is serving
2017-11-12 12:27:30 fauxmo:123 DEBUG Started fauxmo device: {'name': 'test https request', 'plugin': <fauxmo.plugins.simplehttpplugin.SimpleHTTPPlugin object at 0x0000029AA6331A90>}
2017-11-12 12:27:30 fauxmo:125 INFO Starting UDP server
2017-11-12 12:27:30 asyncio:948 DEBUG Datagram endpoint remote_addr=None created: (<_SelectorDatagramTransport fd=756 read=idle write=<idle, bufsize=0>>, <fauxmo.protocols.SSDPServer object at 0x0000029AA6276748>)
2017-11-12 12:27:46 asyncio:1380 INFO poll took 16297.000 ms: 1 events
2017-11-12 12:27:46 fauxmo:170 DEBUG Received data below from ('192.168.1.22', 50000):
2017-11-12 12:27:46 fauxmo:171 DEBUG b'M-SEARCH * HTTP/1.1\r\nMX: 3\r\nST: upnp:rootdevice\r\nHOST: 239.255.255.250:1900\r\nMAN: "ssdp:discover"\r\n\r\n'
2017-11-12 12:27:46 asyncio:1380 DEBUG poll took 0.000 ms: 1 events
2017-11-12 12:27:46 fauxmo:170 DEBUG Received data below from ('192.168.1.22', 50000):
2017-11-12 12:27:46 fauxmo:171 DEBUG b'M-SEARCH * HTTP/1.1\r\nMX: 3\r\nST: ssdp:all\r\nHOST: 239.255.255.250:1900\r\nMAN: "ssdp:discover"\r\n\r\n'
2017-11-12 12:27:47 asyncio:1380 DEBUG poll took 515.000 ms: 1 events
2017-11-12 12:27:47 fauxmo:170 DEBUG Received data below from ('192.168.1.22', 50000):
2017-11-12 12:27:47 fauxmo:171 DEBUG b'M-SEARCH * HTTP/1.1\r\nMX: 3\r\nST: ssdp:all\r\nHOST: 239.255.255.250:1900\r\nMAN: "ssdp:discover"\r\n\r\n'
2017-11-12 12:27:47 asyncio:1380 DEBUG poll took 407.000 ms: 1 events
2017-11-12 12:27:47 fauxmo:170 DEBUG Received data below from ('192.168.1.22', 50000):
2017-11-12 12:27:47 fauxmo:171 DEBUG b'M-SEARCH * HTTP/1.1\r\nMX: 3\r\nST: upnp:rootdevice\r\nHOST: 239.255.255.250:1900\r\nMAN: "ssdp:discover"\r\n\r\n'
2017-11-12 12:27:47 asyncio:1380 DEBUG poll took 0.000 ms: 1 events
2017-11-12 12:27:47 fauxmo:170 DEBUG Received data below from ('192.168.1.22', 50000):
2017-11-12 12:27:47 fauxmo:171 DEBUG b'M-SEARCH * HTTP/1.1\r\nMX: 3\r\nST: ssdp:all\r\nHOST: 239.255.255.250:1900\r\nMAN: "ssdp:discover"\r\n\r\n'
2017-11-12 12:27:48 asyncio:1380 DEBUG poll took 516.000 ms: 1 events
2017-11-12 12:27:48 fauxmo:170 DEBUG Received data below from ('192.168.1.22', 50000):
2017-11-12 12:27:48 fauxmo:171 DEBUG b'M-SEARCH * HTTP/1.1\r\nMX: 3\r\nST: upnp:rootdevice\r\nHOST: 239.255.255.250:1900\r\nMAN: "ssdp:discover"\r\n\r\n'
2017-11-12 12:27:48 asyncio:1380 DEBUG poll took 0.000 ms: 1 events
2017-11-12 12:27:48 fauxmo:170 DEBUG Received data below from ('192.168.1.22', 50000):
2017-11-12 12:27:48 fauxmo:171 DEBUG b'M-SEARCH * HTTP/1.1\r\nMX: 3\r\nST: ssdp:all\r\nHOST: 239.255.255.250:1900\r\nMAN: "ssdp:discover"\r\n\r\n'

confg.json file

{
"FAUXMO": {
"ip_address": "192.168.1.33"
},
"PLUGINS": {
"SimpleHTTPPlugin": {
"DEVICES": [
{
"port": 12345,
"on_cmd": "http://192.168.1.33:8000/get?switch=on",
"off_cmd": "http://192.168.1.33:8000/get?switch=off",
"method": "GET",
"name": "fake switch one"
},
{
"port": 12346,
"on_cmd": "http://127.0.0.1:8000/digest-auth/auth/fauxmouser/fauxmopass",
"off_cmd": "http://127.0.0.1:8000/digest-auth/auth/fauxmouser/fauxmopass",
"user": "fauxmouser",
"password": "fauxmopass",
"name": "fake Indigo switch"
},
{
"port": 12347,
"on_cmd": "http://192.168.1.33:8000/put",
"off_cmd": "http://192.168.1.33:8000/put",
"on_data": {"isOn": 1},
"off_data": {"isOn": 0},
"method": "PUT",
"name": "fake Indigo switch"
},
{
"name": "fake post request",
"port": 12348,
"on_cmd": "http://192.168.1.33:8000/post",
"off_cmd": "http://192.168.1.33:8000/post",
"method": "POST",
"headers": {"x-ha-access": "your_hass_password"},
"on_data": {"entity_id": "switch.fake_hass_switch"},
"off_data": {"entity_id": "switch.fake_hass_switch"}
},
{
"name": "test https request",
"port": 12349,
"on_cmd": "https://httpbin.org/post",
"off_cmd": "https://httpbin.org/post",
"method": "POST",
"headers": {"x-ha-access": "your_hass_password"},
"on_data": {"entity_id": "switch.fake_hass_switch"},
"off_data": {"entity_id": "switch.fake_hass_switch"}
}
]
}
}
}

Please help what went wrong. Trying with Echo 2

small typo to be corrected

hello,
this is not an issue but just a typo and I don't think it deserves a fork.
so :
in the fauxmo plugins repository (here : https://github.com/n8henrie/fauxmo-plugins)
in the file commandlineplugin.py , the example config file is given like this :

{
"FAUXMO": {
"ip_address": "auto"
},
"PLUGINS": {
"CommandLinePlugin": {
"path": "/path/to/commandlineplugin.py",
"DEVICES": [
{
"name": "output stuff to a file",
"port": 49915,
"on_cmd": "touch testfile.txt",
"off_cmd": "rm testfile.txt",
"state_cmd": "ls testfile.txt",
}
]
}
}
}

but it doesn't work, you have to withdraw the coma at the end of the line
"state_cmd": "ls testfile.txt"

this is also an opportunity for me to thank you and congratulate you for this project which is definitly a great achievment !

thank you again

'MQTTPlugin' object has no attribute '_latest_action'

fauxmo v0.8.0
mqttplugin.py my paho-mqtt 2.0.0 patch version jdodgen@8835fe5
Raspbian

I had not done any "discover devices" for a while
But when rebuilding a system with new stuff. I get this error when testing.

'MQTTPlugin' object has no attribute '_latest_action'

it is related to:

    if self.use_fake_state is True:
       return super().get_state()

This can be repeated just by doing another "discover devices"

{
    "FAUXMO": {
        "ip_address": "auto"
    },
    "PLUGINS": {
        "MQTTPlugin": {
            "path": "mqttplugin.py",
            "DEVICES": [
                {
                    "port": 56000,
                    "name": "desk light",
                    "on_cmd": [ "zigbee2mqtt/led on desk/set", "{\"state\": \"ON\"}" ],
                    "off_cmd": [ "zigbee2mqtt/led on desk/set", "{\"state\": \"OFF\"}" ],
                    "mqtt_server": "192.168.0.173",
                    "mqtt_port": 1883,
                    "use_fake_state": true,
                    "initial_state": "off"
                }
            ]
        }
    }
}

Trace

<?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>
2024-04-25 15:02:30 fauxmo:69       INFO     request BasicEvent1
2024-04-25 15:02:30 fauxmo:122      DEBUG    Handling action for plugin type MQTTPlugin(on_cmd='zigbee2mqtt/led on desk/set', on_value='{"state": "ON"}', off_cmd='zigbee2mqtt/led on desk/set', off_value='{"state": "OFF"}', state_cmd=None, status='unknown', _subscribed=False, initial_state=None, use_fake_state=True, client=<paho.mqtt.client.Client object at 0xffff92b8c7d0>, _name='desk light', _port=56000)
2024-04-25 15:02:30 fauxmo:151      INFO     Attempting to get state for desk light
2024-04-25 15:02:30 asyncio:1771     ERROR    Fatal error: protocol.data_received() call failed.
handle_traceback: Handle created at (most recent call last):
  File "/usr/local/bin/fauxmo", line 8, in <module>
    sys.exit(cli())
  File "/home/jim/.local/lib/python3.11/site-packages/fauxmo/cli.py", line 45, in cli
    main(config_path_str=args.config, verbosity=verbosity)
  File "/home/jim/.local/lib/python3.11/site-packages/fauxmo/fauxmo.py", line 165, in main
    loop.run_forever()
  File "/usr/lib/python3.11/asyncio/base_events.py", line 607, in run_forever
    self._run_once()
  File "/usr/lib/python3.11/asyncio/base_events.py", line 1914, in _run_once
    handle._run()
  File "/usr/lib/python3.11/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/lib/python3.11/asyncio/selector_events.py", line 893, in _add_reader
    self._loop._add_reader(fd, callback, *args)
  File "/usr/lib/python3.11/asyncio/selector_events.py", line 263, in _add_reader
    handle = events.Handle(callback, args, self, None)
protocol: <fauxmo.protocols.Fauxmo object at 0xffff91ea9390>
transport: <_SelectorSocketTransport fd=12 read=polling write=<idle, bufsize=0>>
Traceback (most recent call last):
  File "/usr/lib/python3.11/asyncio/selector_events.py", line 1009, in _read_ready__data_received
    self._protocol.data_received(data)
  File "/home/jim/.local/lib/python3.11/site-packages/fauxmo/protocols.py", line 70, in data_received
    self.handle_action(msg)
  File "/home/jim/.local/lib/python3.11/site-packages/fauxmo/protocols.py", line 156, in handle_action
    state = self.plugin.get_state().casefold()
            ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jim/mqttplugin.py", line 228, in get_state
    return super().get_state()
           ^^^^^^^^^^^^^^^^^^^
  File "/home/jim/.local/lib/python3.11/site-packages/fauxmo/plugins/__init__.py", line 98, in get_state
    return self.latest_action
           ^^^^^^^^^^^^^^^^^^
  File "/home/jim/.local/lib/python3.11/site-packages/fauxmo/plugins/__init__.py", line 64, in __getattribute__
    return object.__getattribute__(self, name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jim/.local/lib/python3.11/site-packages/fauxmo/plugins/__init__.py", line 111, in latest_action
    return self._latest_action
           ^^^^^^^^^^^^^^^^^^^
  File "/home/jim/.local/lib/python3.11/site-packages/fauxmo/plugins/__init__.py", line 64, in __getattribute__
    return object.__getattribute__(self, name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'MQTTPlugin' object has no attribute '_latest_action'
2024-04-25 15:02:31 asyncio:167      DEBUG    <Server sockets=(<asyncio.TransportSocket fd=8, family=2, type=1, proto=6, laddr=('192.168.0.173', 56000)>,)> got a new connection from ('192.168.0.205', 44628): <socket.socket fd=12, family=2, type=1, proto=6, laddr=('192.168.0.173', 56000), raddr=('192.168.0.205', 44628)>
2024-04-25 15:02:31 fauxmo:46       DEBUG    Connection made with: ('192.168.0.205', 44628)
2024-04-25 15:02:31 fauxmo:58       DEBUG    Received message:
POST /upnp/control/basicevent1 HTTP/1.1
Host: 192.168.0.173:56000

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.