{"id":16810968,"url":"https://github.com/johnf/smart_energy_group","last_synced_at":"2025-03-17T10:41:55.898Z","repository":{"id":56896191,"uuid":"58781459","full_name":"johnf/smart_energy_group","owner":"johnf","description":"Ruby Library for Smart Energy Group API","archived":false,"fork":false,"pushed_at":"2016-05-16T04:18:35.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-25T14:54:39.693Z","etag":null,"topics":["solar"],"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/johnf.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2016-05-14T00:27:31.000Z","updated_at":"2016-05-14T00:27:49.000Z","dependencies_parsed_at":"2022-08-21T01:50:11.144Z","dependency_job_id":null,"html_url":"https://github.com/johnf/smart_energy_group","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnf%2Fsmart_energy_group","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnf%2Fsmart_energy_group/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnf%2Fsmart_energy_group/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnf%2Fsmart_energy_group/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnf","download_url":"https://codeload.github.com/johnf/smart_energy_group/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244018981,"owners_count":20384673,"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":["solar"],"created_at":"2024-10-13T10:17:16.611Z","updated_at":"2025-03-17T10:41:55.878Z","avatar_url":"https://github.com/johnf.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Smart Energy Group\n\n[![Circle CI](https://circleci.com/gh/johnf/smart_energy_group.svg?style=svg)](https://circleci.com/gh/johnf/smart_energy_group)\n[![Coverage Status](https://coveralls.io/repos/github/johnf/smart_energy_group/badge.svg?branch=master)](https://coveralls.io/github/johnf/smart_energy_group?branch=master)\n\nRuby library for talking to the Smart Energy Group API.\n\nDocumentation for the API can be found at https://smartenergygroups.com/api\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n``` ruby\ngem 'smart_energy_group'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install smart_energy_group\n\n## Usage\n\nIn order to use smart_energy_group in your application you need to use\n\n``` ruby\nrequire 'smart_energy_group/client'\n```\n\nFirst step is to create a Smart Energy Group client using your Smart Energy Group assigned site_token\n\n``` ruby\nseg = SmartEnergyGroup::Client.new(site_token)\n```\n\nYou can then push data points\n\n``` ruby\nseg.send_data(\n  'home',\n  :temperature =\u003e [20.5, 60.0],\n  :power       =\u003e [1023.6, 500.9]\n)\n```\n\nIf you don't have consecutive channels that you want to send you can pass an\narray like so\n\n``` ruby\nseg.send_data(\n  'home',\n  :power       =\u003e { 1 =\u003e 1023.6, 5 =\u003e 500.9 }\n)\n```\n\nThe send_data operation accepts the following options\n\n| Option      | Description |\n| ----------- | ----------- |\n| power       | Power stream with the unit of watts |\n| energy      | Energy stream with the unit prefixed to kilowatt hours |\n| amps        | Current stream with the unit of amps |\n| channel     | Power stream identified with the Phase based on the channel number, with the same settings as a normal power stream |\n| temperature | Temperature stream with default units of Celcius |\n| voltage     | Voltage stream with the units being volts |\n| state       | Switch state stream to determine if a switch is on or off |\n| seconds     | Seconds stream representitive of an elapsed time in seconds |\n| heartbeat   | Boot Event stream to determine if your device has booted and also records a heartbeat to check things are still ticking |\n| pule        | Count of pulses output from a device |\n\n**Note::** The above will raise an error until you put the site into Discovery mode on the SEG website.\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake rspec` to run the tests. You can also 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`, which will 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\nBug reports and pull requests are welcome on GitHub at https://github.com/johnf/pvoutput. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnf%2Fsmart_energy_group","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnf%2Fsmart_energy_group","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnf%2Fsmart_energy_group/lists"}