{"id":19817862,"url":"https://github.com/kevinelliott/power_snoop","last_synced_at":"2025-05-01T11:31:12.404Z","repository":{"id":33721198,"uuid":"37375171","full_name":"kevinelliott/power_snoop","owner":"kevinelliott","description":"Ruby gem to snoop on power consumption from known devices.","archived":false,"fork":false,"pushed_at":"2021-04-29T19:05:13.000Z","size":23,"stargazers_count":5,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-01T23:57:31.845Z","etag":null,"topics":["consumption","heat","power","ruby","ruby-gem"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kevinelliott.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-13T14:49:46.000Z","updated_at":"2021-10-05T22:37:36.000Z","dependencies_parsed_at":"2022-08-28T18:53:28.922Z","dependency_job_id":null,"html_url":"https://github.com/kevinelliott/power_snoop","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinelliott%2Fpower_snoop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinelliott%2Fpower_snoop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinelliott%2Fpower_snoop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinelliott%2Fpower_snoop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kevinelliott","download_url":"https://codeload.github.com/kevinelliott/power_snoop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224253335,"owners_count":17280934,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["consumption","heat","power","ruby","ruby-gem"],"created_at":"2024-11-12T10:13:57.274Z","updated_at":"2024-11-12T10:13:57.424Z","avatar_url":"https://github.com/kevinelliott.png","language":"Ruby","funding_links":["https://www.patreon.com/kevinelliott"],"categories":[],"sub_categories":[],"readme":"To support my open-source work, consider [adding me on Patreon](https://www.patreon.com/kevinelliott).\n\n# PowerSnoop\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fkevinelliott%2Fpower_snoop.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkevinelliott%2Fpower_snoop?ref=badge_shield)\n\n\n\u003cimg src=\"http://www.oldschool993.com/wp-content/uploads/2015/04/Snoop-Dogg-1.jpg\"\u003e\n\nScan, monitor, and calculate power consumption for common devices on and off a network. Support for generic devices will also be included. Special emphasis on consumer home automation equipment (since it often reduces power consumption over time and tracking this will be useful). \n\nFeatures:\n* define and calculate power consumption for a variety of common and specialty electronic devices\n* scan network for known device types\n* monitor and report power consumption over time\n* export reports to data formats and PDFs\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'power_snoop'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install power_snoop\n\n## Usage\n\n```ruby\nrequire 'power_snoop'\n```\n\n### Determine defined consumption for a WeMo Smart LED Bulb when it is turned off\n\n*This is from the manufacturer or one-time measured data. Not real-time.*\n\n```ruby\nPowerSnoop::Devices::Wemo::SmartLEDBulb.consumption_when_off\n```\n\n```ruby\n#\u003cUnitwise::Measurement value=0.5 unit=watt\u003e\n```\n\n### Determine defined maximum consumption for the WeMo Smart LED Bulb\n\n*This is from the manufacturer or one-time measured data. Not real-time.*\n\n```ruby\nPowerSnoop::Devices::Wemo::SmartLEDBulb.consumption_when_max\n```\n\n```ruby\n#\u003cUnitwise::Measurement value=10 unit=watt\u003e\n```\n\n### Determine defined consumption of the WeMo Smart LED Bulb when at dim level 200 (78%)\n\n*This is from the manufacturer or one-time measured data. Not real-time.*\n\n```ruby\nPowerSnoop::Devices::Wemo::SmartLEDBulb.consumption_when_at_dim(200)\n```\n\n```ruby\n#\u003cUnitwise::Measurement value=7.91 unit=watt\u003e\n```\n\n### Scan for WeMo devices on the network\n\n```ruby\nwemo = PowerSnoop::Network::Wemo.new\nlink = wemo.scan_for_devices\nlink.scan_for_devices\n```\n\n```\nBinding to 10.0.0.61:54321\nDiscovering devices\nSent multicast datagram to 239.255.255.250:1900\nFinished waiting 5 seconds\nFound device 'WeMo Link' at 10.0.0.29:49154\n```\n\n### Generic scan for devices on the network using UPnP\n\n```ruby\nupnp = PowerSnoop::Network::UPnP.new\nupnp.ssdp_discover\n```\n\n```ruby\n =\u003e [#\u003cPowerSnoop::Network::UPnPRootDevice:0x007fac629b7a38 @protocol=\"HTTP/1.1 200 OK\", @headers={\"Cache-Control\"=\u003e\"max-age=3600\", \"ST\"=\u003e\"upnp:rootdevice\", \"USN\"=\u003e\"uuid:824ff22b-8c7d-41c5-a131-44f534e125551::upnp:rootdevice\", \"EXT:\"=\u003enil, \"Server\"=\u003e\"Arris/1.0 UPnP/1.0 miniupnpd/1.0\", \"Location\"=\u003e\"http://10.0.0.1:5000/rootDesc.xml\"}\u003e, #\u003cPowerSnoop::Network::UPnPRootDevice:0x007fac629b65e8 @protocol=\"HTTP/1.1 200 OK\", @headers={\"CACHE-CONTROL\"=\u003e\"max-age=86400\", \"DATE\"=\u003e\"Sat, 13 Jun 2015 08:01:06 GMT\", \"EXT:\"=\u003enil, \"LOCATION\"=\u003e\"http://10.0.0.29:49154/setup.xml\", \"OPT\"=\u003e\"\\\"http://schemas.upnp.org/upnp/1/0/\\\"; ns=01\", \"01-NLS\"=\u003e\"97303dd0-1dd1-11b2-bf8b-ebcd1f3911f0\", \"SERVER\"=\u003e\"Unspecified, UPnP/1.0, Unspecified\", \"X-User-Agent\"=\u003e\"redsonic\", \"ST\"=\u003e\"upnp:rootdevice\", \"USN\"=\u003e\"uuid:Bridge-1_0-231447B010024F::upnp:rootdevice\"}\u003e, #\u003cPowerSnoop::Network::UPnPRootDevice:0x007fac629b4d38 @protocol=\"HTTP/1.1 200 OK\", @headers={\"CACHE-CONTROL\"=\u003e\"max-age = 1800\", \"EXT:\"=\u003enil, \"LOCATION\"=\u003e\"http://10.0.0.23:1400/xml/device_description.xml\", \"SERVER\"=\u003e\"Linux UPnP/1.0 Sonos/29.4-90021 (ZPS3)\", \"ST\"=\u003e\"upnp:rootdevice\", \"USN\"=\u003e\"uuid:RINCON_B8E93739D48A01400::upnp:rootdevice\", \"X-RINCON-HOUSEHOLD\"=\u003e\"Sonos_hnBTlpIiWoW0bdq8DvQbngazWc\", \"X-RINCON-BOOTSEQ\"=\u003e\"5030\", \"X-RINCON-PROXY\"=\u003e\"RINCON_000E58B80FF801400\"}\u003e, #\u003cPowerSnoop::Network::UPnPRootDevice:0x007fac6299abb8 @protocol=\"HTTP/1.1 200 OK\", @headers={\"CACHE-CONTROL\"=\u003e\"max-age = 1800\", \"EXT:\"=\u003enil, \"LOCATION\"=\u003e\"http://10.0.0.21:1400/xml/device_description.xml\", \"SERVER\"=\u003e\"Linux UPnP/1.0 Sonos/29.4-90021 (ZPS1)\", \"ST\"=\u003e\"upnp:rootdevice\", \"USN\"=\u003e\"uuid:RINCON_B8E93751CE3801400::upnp:rootdevice\", \"X-RINCON-HOUSEHOLD\"=\u003e\"Sonos_hnBTlpIiWoW0bdq8DvQbngazWc\", \"X-RINCON-BOOTSEQ\"=\u003e\"57\"}\u003e, #\u003cPowerSnoop::Network::UPnPRootDevice:0x007fac6298bcd0 @protocol=\"HTTP/1.1 200 OK\", @headers={\"CACHE-CONTROL\"=\u003e\"max-age = 1800\", \"EXT:\"=\u003enil, \"LOCATION\"=\u003e\"http://10.0.0.22:1400/xml/device_description.xml\", \"SERVER\"=\u003e\"Linux UPnP/1.0 Sonos/29.4-90021 (ZPS1)\", \"ST\"=\u003e\"upnp:rootdevice\", \"USN\"=\u003e\"uuid:RINCON_B8E9375243EA01400::upnp:rootdevice\", \"X-RINCON-HOUSEHOLD\"=\u003e\"Sonos_hnBTlpIiWoW0bdq8DvQbngazWc\", \"X-RINCON-BOOTSEQ\"=\u003e\"43\"}\u003e, #\u003cPowerSnoop::Network::UPnPRootDevice:0x007fac629886c0 @protocol=\"HTTP/1.1 200 OK\", @headers={\"CACHE-CONTROL\"=\u003e\"max-age = 1800\", \"EXT:\"=\u003enil, \"LOCATION\"=\u003e\"http://10.0.0.19:1400/xml/device_description.xml\", \"SERVER\"=\u003e\"Linux UPnP/1.0 Sonos/29.4-90021 (ZPS3)\", \"ST\"=\u003e\"upnp:rootdevice\", \"USN\"=\u003e\"uuid:RINCON_B8E93739D49E01400::upnp:rootdevice\", \"X-RINCON-HOUSEHOLD\"=\u003e\"Sonos_hnBTlpIiWoW0bdq8DvQbngazWc\", \"X-RINCON-BOOTSEQ\"=\u003e\"5156\", \"X-RINCON-PROXY\"=\u003e\"RINCON_000E58B80FF801400\"}\u003e, #\u003cPowerSnoop::Network::UPnPRootDevice:0x007fac629782e8 @protocol=\"HTTP/1.1 200 OK\", @headers={\"CACHE-CONTROL\"=\u003e\"max-age = 1800\", \"EXT:\"=\u003enil, \"LOCATION\"=\u003e\"http://10.0.0.13:1400/xml/device_description.xml\", \"SERVER\"=\u003e\"Linux UPnP/1.0 Sonos/29.4-90021 (ZPS9)\", \"ST\"=\u003e\"upnp:rootdevice\", \"USN\"=\u003e\"uuid:RINCON_000E58B80FF801400::upnp:rootdevice\", \"X-RINCON-HOUSEHOLD\"=\u003e\"Sonos_hnBTlpIiWoW0bdq8DvQbngazWc\", \"X-RINCON-BOOTSEQ\"=\u003e\"44\"}\u003e, #\u003cPowerSnoop::Network::UPnPRootDevice:0x007fac62969f18 @protocol=\"HTTP/1.1 200 OK\", @headers={\"CACHE-CONTROL\"=\u003e\"max-age = 1800\", \"EXT:\"=\u003enil, \"LOCATION\"=\u003e\"http://10.0.0.20:1400/xml/device_description.xml\", \"SERVER\"=\u003e\"Linux UPnP/1.0 Sonos/29.4-90021 (ZPS1)\", \"ST\"=\u003e\"upnp:rootdevice\", \"USN\"=\u003e\"uuid:RINCON_B8E93751CDA601400::upnp:rootdevice\", \"X-RINCON-HOUSEHOLD\"=\u003e\"Sonos_hnBTlpIiWoW0bdq8DvQbngazWc\", \"X-RINCON-BOOTSEQ\"=\u003e\"73\"}\u003e, #\u003cPowerSnoop::Network::UPnPRootDevice:0x007fac63007690 @protocol=\"HTTP/1.1 200 OK\", @headers={\"ST\"=\u003e\"upnp:rootdevice\", \"USN\"=\u003e\"uuid:aca7befe-fba0-4564-842b-05abda43ac97::upnp:rootdevice\", \"Location\"=\u003e\"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\"=\u003enil, \"01-NLS\"=\u003e\"5cdfd8fb775616fb24a010021fea042d\", \"Cache-Control\"=\u003e\"max-age=1800\", \"Server\"=\u003e\"Microsoft-Windows/6.2 UPnP/1.0 UPnP-Device-Host/1.0\", \"Ext\"=\u003enil}\u003e, #\u003cPowerSnoop::Network::UPnPRootDevice:0x007fac63006f60 @protocol=\"HTTP/1.1 200 OK\", @headers={\"ST\"=\u003e\"upnp:rootdevice\", \"USN\"=\u003e\"uuid:ca3b1b50-195b-4e1b-95f6-6b3ab4e85b32::upnp:rootdevice\", \"Location\"=\u003e\"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\"=\u003enil, \"01-NLS\"=\u003e\"5cdfd8fb775616fb24a010021fea042d\", \"Cache-Control\"=\u003e\"max-age=1800\", \"Server\"=\u003e\"Microsoft-Windows/6.2 UPnP/1.0 UPnP-Device-Host/1.0\", \"Ext\"=\u003enil}\u003e]\n```\n\n## Known Devices\n\n### Home Automation\n\n| manufacturer | device | power details | real-time monitoring | status |\n| ------------ | ------ | ------------- | -------------------- | ------ |\n| Belkin | WeMo Link | no | yes | in progress |\n| Belkin | WeMo Smart LED Bulb | yes | yes | in progress |\n| Belkin | WeMo Switch | some | yes | planned |\n| Philips | Vue | yes | yes | planned |\n\n### Televisions\n\n| manufacturer | device | power details | real-time monitoring | status |\n| ------------ | ------ | ------------- | -------------------- | ------ |\n| Samsung | 55\" SmartTV | yes | yes | planned |\n| Sony | 50\" Grand WEGA | yes | no | planned |\n\n### Routers \u0026 Modems\n\n| manufacturer | device | power details | real-time monitoring | status |\n| ------------ | ------ | ------------- | -------------------- | ------ |\n| Arris | Touchstone TG862G/CT Cable Modem | yes | yes | planned |\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\n1. Fork it ( https://github.com/[my-github-username]/power_snoop/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n\n## License\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fkevinelliott%2Fpower_snoop.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkevinelliott%2Fpower_snoop?ref=badge_large)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinelliott%2Fpower_snoop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkevinelliott%2Fpower_snoop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinelliott%2Fpower_snoop/lists"}