{"id":15691776,"url":"https://github.com/marcoroth/netatmo-ruby","last_synced_at":"2025-05-07T23:20:43.528Z","repository":{"id":45148046,"uuid":"184503072","full_name":"marcoroth/netatmo-ruby","owner":"marcoroth","description":"Ruby gem to interact with the Netatmo REST API","archived":false,"fork":false,"pushed_at":"2024-02-20T07:21:16.000Z","size":81,"stargazers_count":8,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-04T20:46:34.120Z","etag":null,"topics":["api","hacktoberfest","netatmo","ruby","weather","wrapper"],"latest_commit_sha":null,"homepage":"","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/marcoroth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-02T01:10:20.000Z","updated_at":"2024-04-30T14:24:30.000Z","dependencies_parsed_at":"2024-02-20T08:25:42.937Z","dependency_job_id":"b8131e84-5239-425f-b20e-55fc9739b148","html_url":"https://github.com/marcoroth/netatmo-ruby","commit_stats":{"total_commits":39,"total_committers":3,"mean_commits":13.0,"dds":0.1282051282051282,"last_synced_commit":"c0519eaac8a6559f3aab9d5ce8b036d924cda528"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcoroth%2Fnetatmo-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcoroth%2Fnetatmo-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcoroth%2Fnetatmo-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcoroth%2Fnetatmo-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcoroth","download_url":"https://codeload.github.com/marcoroth/netatmo-ruby/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252968795,"owners_count":21833357,"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":["api","hacktoberfest","netatmo","ruby","weather","wrapper"],"created_at":"2024-10-03T18:24:41.301Z","updated_at":"2025-05-07T23:20:43.504Z","avatar_url":"https://github.com/marcoroth.png","language":"Ruby","readme":"# Netatmo\n\nRuby API Wrapper for the [Netatmo API](https://dev.netatmo.com/apidocumentation/).\n\n![Build Status](https://github.com/marcoroth/netatmo-ruby/workflows/Build/badge.svg)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'netatmo'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install netatmo\n\n## Usage\n\n### Environment variables\n\n| Name                      | Description            |\n|---------------------------|------------------------|\n| `NETATMO_CLIENT_ID`       | Your app client_id     |\n| `NETATMO_CLIENT_SECRET`   | Your app client_secret |\n| `NETATMO_USERNAME`        | User address email     |\n| `NETATMO_PASSWORD`        | User password          |\n\n### Creating a client\n\nTo create a Netatmo client you can either set the required environment variables or pass the credentials via a config block to the initialize method.\n\n```ruby\n# if you configured the required ENV variables\nclient = Netatmo::Client.new\n\n# or if you want to provide the required credentials\nclient = Netatmo::Client.new do |config|\n  config.client_id = '10acb39bc818e5789'\n  config.client_secret = '10dsfxyzbkzva'\n  config.username = 'user@email.address'\n  config.password = 'UserPassword'\nend\n\n```\n\n### Endpoint `/getstationdata`\n\n`get_station_data` Returns all weather stations you have read access to.\n\n```ruby\nstation_data = client.get_station_data\n# =\u003e #\u003cNetatmo::Weather::StationData @devices=[...] @user=#\u003cNetatmo::User\u003e ...\u003e\n\n```\n\n#### Devices\n\nYou can access the base stations in the `devices` array.\n\n```ruby\nstation_data.devices\n\n# =\u003e [\n#      #\u003cNetatmo::Weather::BaseStation @id=\"00:11:22:00:11:22\", @modules=[...] ...\u003e,\n#      #\u003cNetatmo::Weather::BaseStation @id=\"12:23:34:45:56:67\", @modules=[...] ...\u003e\n#    ]\n\n```\n\n\n\n```ruby\nbase_station = station_data.devices.first\n# =\u003e #\u003cNetatmo::Weather::BaseStation @id=\"00:11:22:00:11:22\", @code=\"NAMain\", @data_types=[\"Temperature\", \"CO2\", \"Humidity\", \"Noise\", \"Pressure\"], @modules=[...]\u003e\n\n```\n\n#### Modules\n\nAll to this base station connected modules are accessible in the `modules` array.\n\n```ruby\nbase_station.modules\n# =\u003e [\n#      #\u003cNetatmo::Weather::OutdoorModule @code=\"NAModule1\", @data_types=[\"Temperature\", \"Humidity\"], ...\u003e,\n#      #\u003cNetatmo::Weather::WindGauge @code=\"NAModule2\", @data_types=[\"Wind\"], ...\u003e,\n#      #\u003cNetatmo::Weather::IndoorModule @code=\"NAModule4\", @data_types=[\"Temperature\", \"CO2\", \"Humidity\"], ...\u003e,\n#      #\u003cNetatmo::Weather::RainGauge @code=\"NAModule3\", @data_types=[\"Rain\"], ...\u003e\n#    ]\n```\n\n```ruby\noutdoor = base_station.modules.first\n\n# =\u003e  #\u003cNetatmo::Weather::OutdoorModule\n#       @id=\"11:22:33:44:55:66\",\n#       @code=\"NAModule1\",\n#       @data_types=[\"Temperature\", \"Humidity\"],\n#       @module_name=\"Module\",\n#       @reachable=true,\n#       @firmware=44,\n#       @last_setup=2014-12-24 21:57:28 +0100,\n#       @last_message=2020-02-11 10:49:33 +0100,\n#       @last_seen=2020-02-11 10:49:27 +0100,\n#       @rf_status=66,\n#       @battery_vp=5440,\n#       @battery_percent=77,\n#       @battery_status=#\u003cNetatmo::BatteryStatus::OutdoorBatteryStatus @value=5440\u003e,\n#       @humidity=#\u003cNetatmo::DashboardData::Humidity @time=2020-02-11 10:48:36 +0100, @value=62.0, @unit=\"%\"\u003e,\n#       @temperature=#\u003cNetatmo::DashboardData::Temperature @time=2020-02-11 10:48:36 +0100, @value=13.6, @min=7.6,\n#       @max=13.6, @min_date=2020-02-11 07:12:25 +0100, @max_date=2020-02-11 10:48:36 +0100,\n#       @trend=#\u003cNetatmo::Util::TempTrend @value=1\u003e,\n#       @unit=\"°C\"\u003e\n#     \u003e\n```\n\n#### Data Types\n\nYou can ask the module if it provides certain data types. \n\n```ruby\noutdoor.temperature?\n# =\u003e true\n```\n\n```ruby\noutdoor.noise?\n# =\u003e false\n```\n\nIf the data type is supported you can access the values.\n\n```ruby\noutdoor.temperature\n# =\u003e #\u003cNetatmo::DashboardData::Temperature @value=13.6, @min=7.6, @max=13.6, @unit=\"°C\", @time=2020-02-11 10:48:36 +0100, @trend=#\u003cNetatmo::Util::TempTrend @value=1\u003e, ...\u003e\n```\n\n#### Values\n\nIf you want to get a hash of all the available data types on the module you use the `values` method. \n\n```ruby\noutdoor.values\n# =\u003e {\n#      :humidity=\u003e#\u003cNetatmo::DashboardData::Humidity ...\u003e,\n#      :temperature=\u003e#\u003cNetatmo::DashboardData::Temperature ...\n#    }\n\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` 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/marcoroth/netatmo-ruby.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcoroth%2Fnetatmo-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcoroth%2Fnetatmo-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcoroth%2Fnetatmo-ruby/lists"}