Um meine Open-Source-Arbeit zu unterstützen, sollten Sie mich über Patreon hinzufügen.
Scannen, Überwachung und Berechnung des Stromverbrauchs für gängige Geräte auf und aus einem Netzwerk. Die Unterstützung für generische Geräte wird ebenfalls enthalten. Besonderer Schwerpunkt auf Ausrüstungsgegenständen für die Automatisierung von Verbrauchern (da dies häufig den Stromverbrauch im Laufe der Zeit reduziert und dies nützlich ist).
Merkmale:
Fügen Sie diese Zeile der GemFile Ihrer Anwendung hinzu:
gem 'power_snoop'Und dann ausführen:
$ bundle
Oder installieren Sie es selbst als:
$ gem install power_snoop
require 'power_snoop'Dies stammt aus dem Hersteller oder einmaligen Messdaten. Nicht in Echtzeit.
PowerSnoop :: Devices :: Wemo :: SmartLEDBulb . consumption_when_off #<Unitwise::Measurement value=0.5 unit=watt>Dies stammt aus dem Hersteller oder einmaligen Messdaten. Nicht in Echtzeit.
PowerSnoop :: Devices :: Wemo :: SmartLEDBulb . consumption_when_max #<Unitwise::Measurement value=10 unit=watt>Dies stammt aus dem Hersteller oder einmaligen Messdaten. Nicht in Echtzeit.
PowerSnoop :: Devices :: Wemo :: SmartLEDBulb . consumption_when_at_dim ( 200 ) #<Unitwise::Measurement value=7.91 unit=watt> wemo = PowerSnoop :: Network :: Wemo . new
link = wemo . scan_for_devices
link . scan_for_devices Binding to 10.0.0.61:54321
Discovering devices
Sent multicast datagram to 239.255.255.250:1900
Finished waiting 5 seconds
Found device 'WeMo Link' at 10.0.0.29:49154
upnp = PowerSnoop :: Network :: UPnP . new
upnp . ssdp_discover => [ #<PowerSnoop::Network::UPnPRootDevice:0x007fac629b7a38 @protocol="HTTP/1.1 200 OK", @headers={"Cache-Control"=>"max-age=3600", "ST"=>"upnp:rootdevice", "USN"=>"uuid:824ff22b-8c7d-41c5-a131-44f534e125551::upnp:rootdevice", "EXT:"=>nil, "Server"=>"Arris/1.0 UPnP/1.0 miniupnpd/1.0", "Location"=>"http://10.0.0.1:5000/rootDesc.xml"}>, #<PowerSnoop::Network::UPnPRootDevice:0x007fac629b65e8 @protocol="HTTP/1.1 200 OK", @headers={"CACHE-CONTROL"=>"max-age=86400", "DATE"=>"Sat, 13 Jun 2015 08:01:06 GMT", "EXT:"=>nil, "LOCATION"=>"http://10.0.0.29:49154/setup.xml", "OPT"=>""http://schemas.upnp.org/upnp/1/0/"; ns=01", "01-NLS"=>"97303dd0-1dd1-11b2-bf8b-ebcd1f3911f0", "SERVER"=>"Unspecified, UPnP/1.0, Unspecified", "X-User-Agent"=>"redsonic", "ST"=>"upnp:rootdevice", "USN"=>"uuid:Bridge-1_0-231447B010024F::upnp:rootdevice"}>, #<PowerSnoop::Network::UPnPRootDevice:0x007fac629b4d38 @protocol="HTTP/1.1 200 OK", @headers={"CACHE-CONTROL"=>"max-age = 1800", "EXT:"=>nil, "LOCATION"=>"http://10.0.0.23:1400/xml/device_description.xml", "SERVER"=>"Linux UPnP/1.0 Sonos/29.4-90021 (ZPS3)", "ST"=>"upnp:rootdevice", "USN"=>"uuid:RINCON_B8E93739D48A01400::upnp:rootdevice", "X-RINCON-HOUSEHOLD"=>"Sonos_hnBTlpIiWoW0bdq8DvQbngazWc", "X-RINCON-BOOTSEQ"=>"5030", "X-RINCON-PROXY"=>"RINCON_000E58B80FF801400"}>, #<PowerSnoop::Network::UPnPRootDevice:0x007fac6299abb8 @protocol="HTTP/1.1 200 OK", @headers={"CACHE-CONTROL"=>"max-age = 1800", "EXT:"=>nil, "LOCATION"=>"http://10.0.0.21:1400/xml/device_description.xml", "SERVER"=>"Linux UPnP/1.0 Sonos/29.4-90021 (ZPS1)", "ST"=>"upnp:rootdevice", "USN"=>"uuid:RINCON_B8E93751CE3801400::upnp:rootdevice", "X-RINCON-HOUSEHOLD"=>"Sonos_hnBTlpIiWoW0bdq8DvQbngazWc", "X-RINCON-BOOTSEQ"=>"57"}>, #<PowerSnoop::Network::UPnPRootDevice:0x007fac6298bcd0 @protocol="HTTP/1.1 200 OK", @headers={"CACHE-CONTROL"=>"max-age = 1800", "EXT:"=>nil, "LOCATION"=>"http://10.0.0.22:1400/xml/device_description.xml", "SERVER"=>"Linux UPnP/1.0 Sonos/29.4-90021 (ZPS1)", "ST"=>"upnp:rootdevice", "USN"=>"uuid:RINCON_B8E9375243EA01400::upnp:rootdevice", "X-RINCON-HOUSEHOLD"=>"Sonos_hnBTlpIiWoW0bdq8DvQbngazWc", "X-RINCON-BOOTSEQ"=>"43"}>, #<PowerSnoop::Network::UPnPRootDevice:0x007fac629886c0 @protocol="HTTP/1.1 200 OK", @headers={"CACHE-CONTROL"=>"max-age = 1800", "EXT:"=>nil, "LOCATION"=>"http://10.0.0.19:1400/xml/device_description.xml", "SERVER"=>"Linux UPnP/1.0 Sonos/29.4-90021 (ZPS3)", "ST"=>"upnp:rootdevice", "USN"=>"uuid:RINCON_B8E93739D49E01400::upnp:rootdevice", "X-RINCON-HOUSEHOLD"=>"Sonos_hnBTlpIiWoW0bdq8DvQbngazWc", "X-RINCON-BOOTSEQ"=>"5156", "X-RINCON-PROXY"=>"RINCON_000E58B80FF801400"}>, #<PowerSnoop::Network::UPnPRootDevice:0x007fac629782e8 @protocol="HTTP/1.1 200 OK", @headers={"CACHE-CONTROL"=>"max-age = 1800", "EXT:"=>nil, "LOCATION"=>"http://10.0.0.13:1400/xml/device_description.xml", "SERVER"=>"Linux UPnP/1.0 Sonos/29.4-90021 (ZPS9)", "ST"=>"upnp:rootdevice", "USN"=>"uuid:RINCON_000E58B80FF801400::upnp:rootdevice", "X-RINCON-HOUSEHOLD"=>"Sonos_hnBTlpIiWoW0bdq8DvQbngazWc", "X-RINCON-BOOTSEQ"=>"44"}>, #<PowerSnoop::Network::UPnPRootDevice:0x007fac62969f18 @protocol="HTTP/1.1 200 OK", @headers={"CACHE-CONTROL"=>"max-age = 1800", "EXT:"=>nil, "LOCATION"=>"http://10.0.0.20:1400/xml/device_description.xml", "SERVER"=>"Linux UPnP/1.0 Sonos/29.4-90021 (ZPS1)", "ST"=>"upnp:rootdevice", "USN"=>"uuid:RINCON_B8E93751CDA601400::upnp:rootdevice", "X-RINCON-HOUSEHOLD"=>"Sonos_hnBTlpIiWoW0bdq8DvQbngazWc", "X-RINCON-BOOTSEQ"=>"73"}>, #<PowerSnoop::Network::UPnPRootDevice:0x007fac63007690 @protocol="HTTP/1.1 200 OK", @headers={"ST"=>"upnp:rootdevice", "USN"=>"uuid:aca7befe-fba0-4564-842b-05abda43ac97::upnp:rootdevice", "Location"=>"http://10.0.0.16:2869/upnphost/udhisapi.dll?content=uuid:aca7befe-fba0-4564-842b-05abda43ac97", "OPT:"http://schemas.upnp.org/upnp/1/0/"; ns=01"=>nil, "01-NLS"=>"5cdfd8fb775616fb24a010021fea042d", "Cache-Control"=>"max-age=1800", "Server"=>"Microsoft-Windows/6.2 UPnP/1.0 UPnP-Device-Host/1.0", "Ext"=>nil}>, #<PowerSnoop::Network::UPnPRootDevice:0x007fac63006f60 @protocol="HTTP/1.1 200 OK", @headers={"ST"=>"upnp:rootdevice", "USN"=>"uuid:ca3b1b50-195b-4e1b-95f6-6b3ab4e85b32::upnp:rootdevice", "Location"=>"http://10.0.0.16:2869/upnphost/udhisapi.dll?content=uuid:ca3b1b50-195b-4e1b-95f6-6b3ab4e85b32", "OPT:"http://schemas.upnp.org/upnp/1/0/"; ns=01"=>nil, "01-NLS"=>"5cdfd8fb775616fb24a010021fea042d", "Cache-Control"=>"max-age=1800", "Server"=>"Microsoft-Windows/6.2 UPnP/1.0 UPnP-Device-Host/1.0", "Ext"=>nil}>] | Hersteller | Gerät | Leistungsdetails | Echtzeitüberwachung | Status |
|---|---|---|---|---|
| Belkin | Wemo Link | NEIN | Ja | im Gange |
| Belkin | Wemo Smart LED -Glühbirne | Ja | Ja | im Gange |
| Belkin | Wemo -Schalter | manche | Ja | geplant |
| Philips | Vue | Ja | Ja | geplant |
| Hersteller | Gerät | Leistungsdetails | Echtzeitüberwachung | Status |
|---|---|---|---|---|
| Samsung | 55 "SmartTV | Ja | Ja | geplant |
| Sony | 50 "Grand Wega | Ja | NEIN | geplant |
| Hersteller | Gerät | Leistungsdetails | Echtzeitüberwachung | Status |
|---|---|---|---|---|
| Arris | Touchstone TG862G/CT -Kabelmodem | Ja | Ja | geplant |
Führen Sie bin/setup nach dem Auschecken des Repo aus, um Abhängigkeiten zu installieren. Führen Sie dann bin/console für eine interaktive Eingabeaufforderung aus, mit der Sie experimentieren können.
Um dieses Juwel auf Ihrem lokalen Computer zu installieren, führen Sie bundle exec rake install aus. Um eine neue Version zu veröffentlichen, aktualisieren Sie die Versionsnummer in version.rb und führen Sie bundle exec rake release aus, um ein Git -Tag für die Version zu erstellen, Git Commits und Tags zu drücken und die .gem -Datei auf rubygemems.org zu bringen.
git checkout -b my-new-feature ).git commit -am 'Add some feature' )git push origin my-new-feature )