gazpar2haws 0.2.0b1__py3-none-any.whl → 0.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,278 +0,0 @@
1
- Metadata-Version: 2.3
2
- Name: gazpar2haws
3
- Version: 0.2.0b1
4
- Summary: Gazpar2HAWS is a gateway that reads data history from the GrDF (French gas provider) meter and send it to Home Assistant using WebSocket interface
5
- License: MIT License
6
-
7
- Copyright (c) 2024 Stéphane Senart
8
-
9
- Permission is hereby granted, free of charge, to any person obtaining a copy
10
- of this software and associated documentation files (the "Software"), to deal
11
- in the Software without restriction, including without limitation the rights
12
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
- copies of the Software, and to permit persons to whom the Software is
14
- furnished to do so, subject to the following conditions:
15
-
16
- The above copyright notice and this permission notice shall be included in all
17
- copies or substantial portions of the Software.
18
-
19
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
- SOFTWARE.
26
- Author: Stéphane Senart
27
- Requires-Python: >=3.9
28
- Classifier: Programming Language :: Python :: 3.9
29
- Classifier: Programming Language :: Python :: 3.10
30
- Classifier: Programming Language :: Python :: 3.11
31
- Classifier: Programming Language :: Python :: 3.12
32
- Requires-Dist: pygazpar (>=1.2.7)
33
- Requires-Dist: pyyaml (>=6.0.2)
34
- Requires-Dist: websockets (>=14.1)
35
- Description-Content-Type: text/markdown
36
-
37
- # gazpar2haws
38
-
39
- Gazpar2HAWS is a gateway that reads data history from the GrDF (French gas provider) meter and send it to Home Assistant using WebSocket interface.
40
-
41
- It is compatible with Home Assistant Energy Dashboard and permits to upload the history and keep it updated with the latest readings.
42
-
43
- It is a complement to the other available projects:
44
-
45
- - [home-assistant-gazpar](https://github.com/ssenart/home-assistant-gazpar): HA integration that publishes a Gazpar entity with the corresponding meter value.
46
- - [gazpar2mqtt](https://github.com/ssenart/gazpar2mqtt): [home-assistant-gazpar](https://github.com/ssenart/home-assistant-gazpar) alternative but using MQTT events (it reduce coupling with HA).
47
- - [lovelace-gazpar-card](https://github.com/ssenart/lovelace-gazpar-card): HA dashboard card compatible with [home-assistant-gazpar](https://github.com/ssenart/home-assistant-gazpar) and [gazpar2mqtt](https://github.com/ssenart/gazpar2mqtt).
48
-
49
- ## Installation
50
-
51
- Gazpar2HAWS can be installed in many ways.
52
-
53
- ### 1. Home Assistant Add-on
54
-
55
- In the **Add-on store**, click **⋮ → Repositories**, fill in **`https://github.com/ssenart/gazpar2haws`** and click **Add → Close** or click the **Add repository** button below, click **Add → Close** (You might need to enter the **internal IP address** of your Home Assistant instance first).
56
-
57
- [![Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.](https://my.home-assistant.io/badges/supervisor_add_addon_repository.svg)](https://my.home-assistant.io/redirect/supervisor_add_addon_repository/?repository_url=https%3A%2F%2Fgithub.com%2Fssenart%2Fgazpar2haws)
58
-
59
- For usage and configuration, read the documentation [here](addons/gazpar2haws/DOCS.md).
60
-
61
- ### 2. Using Docker Hub
62
-
63
- The following steps permits to run a container from an existing image available in the Docker Hub repository.
64
-
65
- 1. Copy and save the following docker-compose.yaml file:
66
-
67
- ```yaml
68
- services:
69
- gazpar2haws:
70
- image: ssenart/gazpar2haws:latest
71
- container_name: gazpar2haws
72
- restart: unless-stopped
73
- network_mode: bridge
74
- user: "1000:1000"
75
- volumes:
76
- - ./gazpar2haws/config:/app/config
77
- - ./gazpar2haws/log:/app/log
78
- environment:
79
- - GRDF_USERNAME=<GrDF account username>
80
- - GRDF_PASSWORD=<GrDF account password>
81
- - GRDF_PCE_IDENTIFIER=<GrDF PCE meter identifier>
82
- - HOMEASSISTANT_HOST=<Home Assistant instance host name>
83
- - HOMEASSISTANT_TOKEN=<Home Assistant access token>
84
- ```
85
-
86
- Edit the environment variable section according to your setup.
87
-
88
- 2. Run the container:
89
- ```sh
90
- $ docker compose up -d
91
- ```
92
-
93
- ### 3. Using PIP package
94
-
95
- ```sh
96
- $ cd /path/to/my_install_folder/
97
-
98
- $ mkdir gazpar2haws
99
-
100
- $ cd gazpar2haws
101
-
102
- $ python -m venv .venv
103
-
104
- $ source .venv/bin/activate
105
-
106
- $ pip install gazpar2haws
107
-
108
- ```
109
-
110
- ### 4. Using Dockerfile
111
-
112
- The following steps permit to build the Docker image based on the local source files.
113
-
114
- 1. Clone the repo locally:
115
- ```sh
116
- $ cd /path/to/my_install_folder/
117
-
118
- $ git clone https://github.com/ssenart/gazpar2haws.git
119
- ```
120
- 2. Edit the docker-compose.yaml file by setting the environment variables corresponding to your GrDF account and Home Assistant setup:
121
-
122
- ```yaml
123
- environment:
124
- - GRDF_USERNAME=<GrDF account username>
125
- - GRDF_PASSWORD=<GrDF account password>
126
- - GRDF_PCE_IDENTIFIER=<GrDF PCE meter identifier>
127
- - HOMEASSISTANT_HOST=<Home Assistant instance host name>
128
- - HOMEASSISTANT_PORT=<Home Assistant instance port number>
129
- - HOMEASSISTANT_TOKEN=<Home Assistant access token>
130
- ```
131
- 3. Build the image:
132
- ```sh
133
- $ docker compose -f docker/docker-compose.yaml build
134
- ```
135
- 4. Run the container:
136
- ```sh
137
- $ docker compose -f docker/docker-compose.yaml up -d
138
- ```
139
-
140
- ### 5. Using source files
141
-
142
- The project requires [Poetry](https://python-poetry.org/) tool for dependency and package management.
143
-
144
- ```sh
145
- $ cd /path/to/my_install_folder/
146
-
147
- $ git clone https://github.com/ssenart/gazpar2haws.git
148
-
149
- $ cd gazpar2haws
150
-
151
- $ poetry install
152
-
153
- $ poetry shell
154
-
155
- ```
156
-
157
- ## Usage
158
-
159
- ### Command line
160
-
161
- ```sh
162
- $ python -m gazpar2haws --config /path/to/configuration.yaml --secrets /path/to/secrets.yaml
163
- ```
164
-
165
- ### Configuration file
166
-
167
- The default configuration file is below.
168
-
169
- ```yaml
170
- logging:
171
- file: log/gazpar2haws.log
172
- console: true
173
- level: debug
174
- format: '%(asctime)s %(levelname)s [%(name)s] %(message)s'
175
-
176
- grdf:
177
- scan_interval: 0 # Number of minutes between each data retrieval (0 means no scan: a single data retrieval at startup, then stops).
178
- devices:
179
- - name: gazpar2haws # Name of the device in home assistant. It will be used as the entity_ids: sensor.${name}_volume and sensor.${name}_energy.
180
- username: "!secret grdf.username"
181
- password: "!secret grdf.password"
182
- pce_identifier: "!secret grdf.pce_identifier"
183
- timezone: Europe/Paris
184
- last_days: 365 # Number of days of data to retrieve
185
- reset: false # If true, the data will be reset before the first data retrieval
186
-
187
- homeassistant:
188
- host: "!secret homeassistant.host"
189
- port: "!secret homeassistant.port"
190
- token: "!secret homeassistant.token"
191
- ```
192
-
193
- The default secret file:
194
-
195
- ```yaml
196
- grdf.username: ${GRDF_USERNAME}
197
- grdf.password: ${GRDF_PASSWORD}
198
- grdf.pce_identifier: ${GRDF_PCE_IDENTIFIER}
199
-
200
- homeassistant.host: ${HA_HOST}
201
- homeassistant.port: ${HA_PORT}
202
- homeassistant.token: ${HA_TOKEN}
203
- ```
204
-
205
- The history is uploaded on the entities with names:
206
- - sensor.${name}_volume: Volume history in m³.
207
- - sensor.${name}_energy: Energy history in kWh.
208
-
209
- `${name}` is 'gazpar2haws' defined in the above configuration file. It can be replaced by any other name.
210
-
211
- ### Environment variable for Docker
212
-
213
- In a Docker environment, the configurations files are instantiated by replacing the environment variables below in the template files:
214
-
215
- | Environment variable | Description | Required | Default value |
216
- |---|---|---|---|
217
- | GRDF_USERNAME | GrDF account user name | Yes | - |
218
- | GRDF_PASSWORD | GrDF account password (avoid using special characters) | Yes | - |
219
- | GRDF_PCE_IDENTIFIER | GrDF meter PCE identifier | Yes | - |
220
- | GRDF_SCAN_INTERVAL | Period in minutes to refresh meter data (0 means one single refresh and stop) | No | 480 (8 hours) |
221
- | GRDF_LAST_DAYS | Number of days of history data to retrieve | No | 1095 (3 years) |
222
- | HOMEASSISTANT_HOST | Home Assistant instance host name | Yes | - |
223
- | HOMEASSISTANT_PORT | Home Assistant instance port number | No | 8123 |
224
- | HOMEASSISTANT_TOKEN | Home Assistant access token | Yes | - |
225
-
226
- You can setup them directly in a docker-compose.yaml file (environment section) or from a Docker command line (-e option).
227
-
228
- ## Publish a new image on Docker Hub
229
-
230
- 1. List all local images
231
-
232
- ```sh
233
- $ docker image ls
234
- ```
235
-
236
- 2. Build a new local image
237
-
238
- ```sh
239
- $ docker compose -f docker/docker-compose.yaml build
240
- ```
241
-
242
- 3. Tag the new built image with the version number
243
-
244
- ```sh
245
- $ docker image tag ssenart/gazpar2haws:latest ssenart/gazpar2haws:0.1.2
246
- ```
247
-
248
- 4. Login in Docker Hub
249
-
250
- ```sh
251
- $ docker login
252
- ```
253
-
254
- 5. Push all the tagged local images to Docker Hub
255
-
256
- ```sh
257
- $ docker push --all-tags ssenart/gazpar2haws
258
- ```
259
-
260
- All the gazpar2haws images are available [here](https://hub.docker.com/repository/docker/ssenart/gazpar2haws/general).
261
-
262
- ## Contributing
263
-
264
- Pull requests are welcome. For any change proposal, please open an issue first to discuss what you would like to change.
265
-
266
- Please make sure to update tests as appropriate.
267
-
268
- ## License
269
-
270
- [MIT](https://choosealicense.com/licenses/mit/)
271
-
272
- ## Project status
273
-
274
- Gazpar2HAWS has been initiated for integration with [Home Assistant](https://www.home-assistant.io/) energy dashboard.
275
-
276
-
277
-
278
-
@@ -1,11 +0,0 @@
1
- gazpar2haws/__init__.py,sha256=3MCDQdGGmT3FQMKaAB3mBJq7L75T_bJSdpDRjE-pado,58
2
- gazpar2haws/__main__.py,sha256=KdhkowqJP6L8WTF9FNpTy4ZzDf1OPARm6mVtMclxGFk,3265
3
- gazpar2haws/bridge.py,sha256=s8ENqugNhxTJMAOJzRwVt1YidwxzbPfwdWKx7TLQN7w,3625
4
- gazpar2haws/config_utils.py,sha256=89ClKudFGxiT_EnzqRhfEvYVm9SeWq6U2xhNjvm3hhs,2161
5
- gazpar2haws/gazpar.py,sha256=6FyKUKtvn9zlpHbyaUvEYs6uUK7Bnx8LDGB9Nbs_E58,8327
6
- gazpar2haws/haws.py,sha256=H--UWGECYq9JYlbU6IHLO2btaRXInwoVRZnHIXSA1ts,8169
7
- gazpar2haws/version.py,sha256=9Iq5Jm63Ev7QquCjhDqa9_KAgHdKl9FJHynq8M6JNrY,83
8
- gazpar2haws-0.2.0b1.dist-info/LICENSE,sha256=ajApZPyhVx8AU9wN7DXeRGhoWFqY2ylBZUa5GRhTmok,1073
9
- gazpar2haws-0.2.0b1.dist-info/METADATA,sha256=-TB33G3v3eu9r1Uv33ffcP-zBRMpBQBIY3nezSwYFV4,9452
10
- gazpar2haws-0.2.0b1.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
11
- gazpar2haws-0.2.0b1.dist-info/RECORD,,