Giter Club home page Giter Club logo

homematic_exporter's People

Contributors

denzs avatar dependabot[bot] avatar earl avatar kremers avatar mrueg avatar sfudeus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

homematic_exporter's Issues

HMIP-SWDO OPEN/CLOSED not shown

I am using HMIP-SWDO and want to see window opening status.
Any idea how to troubleshoot why a lot of metrics of the HMIP-SWDO beside the intresting opening state?

I guess it has something todo with OPEN/CLOSED are strings and have to be converted to int 1/0 in the script?

{'ADDRESS': '0000DA499C6BE4',
  'AES_ACTIVE': 1,
  'AVAILABLE_FIRMWARE': '0.0.0',
  'CHILDREN': ['0000DA499C6BE4:0', '0000DA499C6BE4:1', '0000DA499C6BE4:2'],
  'DIRECTION': 0,
  'FIRMWARE': '1.16.8',
  'FIRMWARE_UPDATE_STATE': 'UP_TO_DATE',
  'FLAGS': 1,
  'GROUP': '',
  'INDEX': 0,
  'INTERFACE': '',
  'LINK_SOURCE_ROLES': '',
  'LINK_TARGET_ROLES': '',
  'PARAMSETS': ['MASTER', 'SERVICE'],
  'PARENT': '',
  'PARENT_TYPE': '',
  'RF_ADDRESS': 8415741,
  'ROAMING': 0,
  'RX_MODE': 4,
  'SUBTYPE': 'SWD',
  'TEAM': '',
  'TEAM_CHANNELS': [],
  'TEAM_TAG': '',
  'TYPE': 'HMIP-SWDO',
  'UPDATABLE': True,
  'VERSION': 2},
{'ADDRESS': '0000DA499C6BE4:0',
  'AES_ACTIVE': 1,
  'AVAILABLE_FIRMWARE': '',
  'CHILDREN': [],
  'DIRECTION': 0,
  'FIRMWARE': '',
  'FIRMWARE_UPDATE_STATE': '',
  'FLAGS': 1,
  'GROUP': '',
  'INDEX': 0,
  'INTERFACE': '',
  'LINK_SOURCE_ROLES': '',
  'LINK_TARGET_ROLES': '',
  'PARAMSETS': ['MASTER', 'VALUES', 'SERVICE'],
  'PARENT': '0000DA499C6BE4',
  'PARENT_TYPE': 'HMIP-SWDO',
  'RF_ADDRESS': 0,
  'ROAMING': 0,
  'RX_MODE': 0,
  'SUBTYPE': '',
  'TEAM': '',
  'TEAM_CHANNELS': [],
  'TEAM_TAG': '',
  'TYPE': 'MAINTENANCE',
  'UPDATABLE': True,
  'VERSION': 2},
{'ADDRESS': '0000DA499C6BE4:1',
  'AES_ACTIVE': 1,
  'AVAILABLE_FIRMWARE': '',
  'CHILDREN': [],
  'DIRECTION': 1,
  'FIRMWARE': '',
  'FIRMWARE_UPDATE_STATE': '',
  'FLAGS': 1,
  'GROUP': '',
  'INDEX': 1,
  'INTERFACE': '',
  'LINK_SOURCE_ROLES': 'WINDOW_SWITCH CONDITIONAL_SWITCH',
  'LINK_TARGET_ROLES': '',
  'PARAMSETS': ['MASTER', 'VALUES', 'LINK', 'SERVICE'],
  'PARENT': '0000DA499C6BE4',
  'PARENT_TYPE': 'HMIP-SWDO',
  'RF_ADDRESS': 0,
  'ROAMING': 0,
  'RX_MODE': 0,
  'SUBTYPE': '',
  'TEAM': '',
  'TEAM_CHANNELS': [],
  'TEAM_TAG': '',
  'TYPE': 'SHUTTER_CONTACT',
  'UPDATABLE': True,
  'VERSION': 2},
 {'ADDRESS': '0000DA499C6BE4:2',
  'AES_ACTIVE': 1,
  'AVAILABLE_FIRMWARE': '',
  'CHILDREN': [],
  'DIRECTION': 0,
  'FIRMWARE': '',
  'FIRMWARE_UPDATE_STATE': '',
  'FLAGS': 0,
  'GROUP': '',
  'INDEX': 2,
  'INTERFACE': '',
  'LINK_SOURCE_ROLES': '',
  'LINK_TARGET_ROLES': '',
  'PARAMSETS': ['MASTER', 'VALUES', 'SERVICE'],
  'PARENT': '0000DA499C6BE4',
  'PARENT_TYPE': 'HMIP-SWDO',
  'RF_ADDRESS': 0,
  'ROAMING': 0,
  'RX_MODE': 0,
  'SUBTYPE': '',
  'TEAM': '',
  'TEAM_CHANNELS': [],
  'TEAM_TAG': '',
  'TYPE': 'ALARM_COND_SWITCH_TRANSMITTER',
  'UPDATABLE': True,
  'VERSION': 2},

Parameter dump:

--dump_parameters 0000DA499C6BE1:1
{'STATE': 0}

Timed out port confusion

I get this error message:

 2021-10-31 23:14:00,801 - INFO - Starting thread for data gathering                                                                                                                                            │
│ 2021-10-31 23:14:00,801 - INFO - Exposing metrics on port 9133                                                                                                                                                 │
│ 2021-10-31 23:14:00,801 - INFO - Mapping 0 devices with custom names                                                                                                                                           │
│ 2021-10-31 23:14:00,802 - INFO - Supporting 46 device types: HmIP-eTRV-2,HmIP-FSM,HMIP-PSM,HmIP-RCV-1,HmIP-STH,HmIP-STHD,HmIP-SWD,HMIP-SWDO,HmIP-SWSD,HmIP-SWO-PL,HmIP-SWO-PR,HmIP-WTH-2,HM-CC-RT-DN,HM-Dis-EP │
│ 2021-10-31 23:14:00,811 - DEBUG - Starting new HTTP connection (1): xx.xx.xx.xx:8181                                                                                                                            │
│ Exception in thread Thread-1:                                                                                                                                                                                  │
│ Traceback (most recent call last):                                                                                                                                                                             │
│   File "/usr/local/lib/python3.10/site-packages/urllib3/connection.py", line 174, in _new_conn                                                                                                                 │
│     conn = connection.create_connection(                                                                                                                                                                       │
│   File "/usr/local/lib/python3.10/site-packages/urllib3/util/connection.py", line 96, in create_connection                                                                                                     │
│     raise err                                                                                                                                                                                                  │
│   File "/usr/local/lib/python3.10/site-packages/urllib3/util/connection.py", line 86, in create_connection                                                                                                     │
│     sock.connect(sa)                                                                                            

Why is it connecting to port 8181? my args are these:

│       xx.xx.xx.xx                                                                                                                                                                                               │
│       --ccu_port                                                                                                                                                                                               │
│       2001                                                                                                                                                                                                     │
│       --port                                                                                                                                                                                                   │
│       9133                                                                                                                                                                                                     │
│       --debug 

I am wondering why I can access my ccu3 using home assistant just fine...

Export user defined variables

Hi,

Is there a way to export the values of the variables (in my case user defined variables) as well as the values of the devices?

BR
Benjamin

config file issue

Having a somewhat similar problem to #9

When I dont include any config file I do get a couple of metrics from the ccu exported just fine, but no devices itself

root@nas:~# curl http://127.0.0.1:9789/metrics
(...)
(removing the python_ and process_ lines for sake of readability)
# HELP homematic_devicecount Number of processed/supported devices
# TYPE homematic_devicecount gauge
homematic_devicecount{ccu="192.168.1.30"} 55.0
# HELP homematic_gathering_count_total Amount of gathering runs
# TYPE homematic_gathering_count_total counter
homematic_gathering_count_total{ccu="192.168.1.30"} 2.0
# HELP homematic_gathering_count_created Amount of gathering runs
# TYPE homematic_gathering_count_created gauge
homematic_gathering_count_created{ccu="192.168.1.30"} 1.6416874286899266e+09
# HELP homematic_gathering_errors_total Amount of failed gathering runs
# TYPE homematic_gathering_errors_total counter
# HELP homematic_generate_metrics_seconds Time spent in gathering runs
# TYPE homematic_generate_metrics_seconds summary
homematic_generate_metrics_seconds_count{ccu="192.168.1.30"} 2.0
homematic_generate_metrics_seconds_sum{ccu="192.168.1.30"} 0.2012096792459488
# HELP homematic_generate_metrics_seconds_created Time spent in gathering runs
# TYPE homematic_generate_metrics_seconds_created gauge
homematic_generate_metrics_seconds_created{ccu="192.168.1.30"} 1.6416874286899843e+09
# HELP homematic_read_names_seconds Time spent reading names from CCU
# TYPE homematic_read_names_seconds summary
homematic_read_names_seconds_count{ccu="192.168.1.30"} 1.0
homematic_read_names_seconds_sum{ccu="192.168.1.30"} 0.02728335279971361
# HELP homematic_read_names_seconds_created Time spent reading names from CCU
# TYPE homematic_read_names_seconds_created gauge
homematic_read_names_seconds_created{ccu="192.168.1.30"} 1.6416874286621323e+09

When I add --config_file /config/config.json to Dockerfile "command" (and mapping a config.json in /config of course) I dont get any output with homematic_

root@nas:~# curl http://127.0.0.1:9789/metrics
(...)
(removing the python_ and process_ lines for sake of readability)
# HELP homematic_devicecount Number of processed/supported devices
# TYPE homematic_devicecount gauge
# HELP homematic_gathering_count_total Amount of gathering runs
# TYPE homematic_gathering_count_total counter
# HELP homematic_gathering_errors_total Amount of failed gathering runs
# TYPE homematic_gathering_errors_total counter
# HELP homematic_generate_metrics_seconds Time spent in gathering runs
# TYPE homematic_generate_metrics_seconds summary
# HELP homematic_read_names_seconds Time spent reading names from CCU
# TYPE homematic_read_names_seconds summary

--dump_devices and --dump_device_names works just fine with and without a config file

docker logs without config file

2022-01-09 00:29:39,505 - INFO - Starting thread for data gathering
2022-01-09 00:29:39,505 - INFO - Exposing metrics on port 9789
2022-01-09 00:29:39,507 - INFO - Mapping 0 devices with custom names
2022-01-09 00:29:39,508 - INFO - Supporting 46 device types: HmIP-eTRV-2,HmIP-FSM,HMIP-PSM,HmIP-RCV-1,HmIP-STH,HmIP-STHD,HmIP-SWD,HMIP-SWDO,HmIP-SWSD,HmIP-SWO-PL,HmIP-SWO-PR,HmIP-WTH-2,HM-CC-RT-DN,HM-Dis-EP-WM55,HM-Dis-WM55,HM-ES-PMSw1-Pl-DN-R5,HM-ES-TX-WM,HM-LC-Bl1-FM,HM-LC-Dim1PWM-CV,HM-LC-Dim1T-FM,HM-LC-RGBW-WM,HM-LC-Sw1-Pl-DN-R5,HM-LC-Sw1-FM,HM-LC-Sw2-FM,HM-OU-CFM-Pl,HM-OU-CFM-TW,HM-PBI-4-FM,HM-PB-2-WM55,HM-PB-6-WM55,HM-RC-P1,HM-RC-4-2,HM-RC-8,HM-Sec-MDIR-2,HM-Sec-SCo,HM-Sec-SC-2,HM-Sec-SD-2,HM-Sec-TiS,HM-Sen-LI-O,HM-Sen-MDIR-O,HM-Sen-MDIR-WM55,HM-SwI-3-FM,HM-TC-IT-WM-W-EU,HM-WDS10-TH-O,HM-WDS100-C6-O-2,HM-WDS30-OT2-SM,HM-WDS40-TH-I-2
2022-01-09 00:29:39,545 - INFO - Read 214 device names from CCU
2022-01-09 00:29:39,546 - INFO - Gathering metrics
2022-01-09 00:29:39,649 - INFO - Found unsupported top-level device 001FDBE98A7517 of type HmIP-FCI1
2022-01-09 00:29:39,650 - INFO - Found unsupported top-level device HmIP-RCV-1 of type HmIP-RCV-50
2022-01-09 00:30:39,706 - INFO - Gathering metrics
2022-01-09 00:30:39,799 - INFO - Found unsupported top-level device 001FDBE98A7517 of type HmIP-FCI1
2022-01-09 00:30:39,799 - INFO - Found unsupported top-level device HmIP-RCV-1 of type HmIP-RCV-50
2022-01-09 00:31:39,859 - INFO - Gathering metrics
2022-01-09 00:31:39,954 - INFO - Found unsupported top-level device 001FDBE98A7517 of type HmIP-FCI1
2022-01-09 00:31:39,954 - INFO - Found unsupported top-level device HmIP-RCV-1 of type HmIP-RCV-50
2022-01-09 00:32:40,015 - INFO - Gathering metrics
2022-01-09 00:32:40,110 - INFO - Found unsupported top-level device 001FDBE98A7517 of type HmIP-FCI1
2022-01-09 00:32:40,111 - INFO - Found unsupported top-level device HmIP-RCV-1 of type HmIP-RCV-50
2022-01-09 00:33:40,170 - INFO - Gathering metrics
2022-01-09 00:33:40,274 - INFO - Found unsupported top-level device 001FDBE98A7517 of type HmIP-FCI1
2022-01-09 00:33:40,274 - INFO - Found unsupported top-level device HmIP-RCV-1 of type HmIP-RCV-50
2022-01-09 00:34:40,333 - INFO - Gathering metrics
2022-01-09 00:34:40,432 - INFO - Found unsupported top-level device 001FDBE98A7517 of type HmIP-FCI1
2022-01-09 00:34:40,432 - INFO - Found unsupported top-level device HmIP-RCV-1 of type HmIP-RCV-50


docker logs with config file

2022-01-09 00:36:08,597 - INFO - Processing config file /config/config.json
2022-01-09 00:36:08,599 - INFO - Starting thread for data gathering
2022-01-09 00:36:08,600 - INFO - Exposing metrics on port 9789
2022-01-09 00:36:08,600 - INFO - Mapping 2 devices with custom names
2022-01-09 00:36:08,603 - INFO - Supporting 46 device types: HmIP-eTRV-2,HmIP-FSM,HMIP-PSM,HmIP-RCV-1,HmIP-STH,HmIP-STHD,HmIP-SWD,HMIP-SWDO,HmIP-SWSD,HmIP-SWO-PL,HmIP-SWO-PR,HmIP-WTH-2,HM-CC-RT-DN,HM-Dis-EP-WM55,HM-Dis-WM55,HM-ES-PMSw1-Pl-DN-R5,HM-ES-TX-WM,HM-LC-Bl1-FM,HM-LC-Dim1PWM-CV,HM-LC-Dim1T-FM,HM-LC-RGBW-WM,HM-LC-Sw1-Pl-DN-R5,HM-LC-Sw1-FM,HM-LC-Sw2-FM,HM-OU-CFM-Pl,HM-OU-CFM-TW,HM-PBI-4-FM,HM-PB-2-WM55,HM-PB-6-WM55,HM-RC-P1,HM-RC-4-2,HM-RC-8,HM-Sec-MDIR-2,HM-Sec-SCo,HM-Sec-SC-2,HM-Sec-SD-2,HM-Sec-TiS,HM-Sen-LI-O,HM-Sen-MDIR-O,HM-Sen-MDIR-WM55,HM-SwI-3-FM,HM-TC-IT-WM-W-EU,HM-WDS10-TH-O,HM-WDS100-C6-O-2,HM-WDS30-OT2-SM,HM-WDS40-TH-I-2
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/threading.py", line 1009, in _bootstrap_inner
    self.run()
  File "/usr/local/bin/homematic_exporter", line 129, in run
    if reload_names_active:
UnboundLocalError: local variable 'reload_names_active' referenced before assignment

here is my config, this is just your example with the added supported devices removed

{
  "device_mapping": {
    "00112233445566": "Garden",
    "00778899aaccdd": "Room1"
  }
}

HM-WDS40-TH-I-2

Hi,

got my first wireless temperature/humidity sensor today (HM-WDS40-TH-I-2) and it works like a charm with your exporter.
Just wanted to let you know :)

Support authentication

Hi,

API endpoints are secured by default. After upgrading my CCU 3 I had to manually disable authentication. Would it be possible to support authenticated connection?

Support name mapping based on device address prefix

A mapped name typically would be fitting to the parent device, not to its sub-devices. Multiple sub-devices should appear with the same name. Currently, the explicit sub-device must be present in the mapping config.
Either the parent name must be checked for an existing mapping, too - or a regex-matching should be implemented.

Prometheus.yaml config

hi,

I installed the homematic_exporter and run it with
python3 exporter.py --ccu_host 192.168.10.170 --ccu_port 2010 --interval 15 --port 9411 --debug

It successfully fetches all the data from the ccu but homematic metrics don't show up in prometheus.
here's my prometheus.yaml:

#scrape homematic

  • job_name: 'homematic'
    static_configs:
    • targets: ['localhost:9411']

what am I doing from?

Best

Wish: Provide filter possibility

I've a lot of Homematic Devices attached to my CCU and I really would like to specify which values should be written out to the webserver (e.g just homematic_low_bat, homematic_unreach, .... ) so that I can decrease the dataset a little bit.

Ideally this could be set via configuration file (defaulting to all of course).

HM-WDS10-TH-O

Hi,
just tried to use your exporter with the outdoor sensor mentioned above. Works like a charm :)

HmIP-SWDO state not available

With --dump_parameters XXXXXXXXXXXXX:1 i get

getParamset:
{'STATE': 0}

when closed and {'STATE': 1} when open.
But in the metrics are only

homematic_config_pending
homematic_duty_cycle
homematic_low_bat
homematic_unreach
homematic_rssi_device
homematic_operating_voltage
homematic_update_pending
homematic_error_code
homematic_sabotage
homematic_state_set
homematic_state_set

CCU3 / Firmware 3.65.8

Support for non ip devices

Hi,

I'd like to provide a PR which adds support for HM-CC-RT-DN device. This isn't a HomematicIP device, so the process to gather
device stats is a bit different. To fetch those, the exporter needs to talk to a different XML-RPC service which is listening
by default on port 2001 of the ccu.

My first question is, would it be OK for you to add support for non IP devices to your exporter?

I assume (haven't tested it yet, because I don't own more devices) your exporter would be able to support further non IP devices by default, without changing the current gathering logic. This would be a great improvement in my opinion :)

In case you are fine with a PR, how would you integrate this feature into your code? I'm struggling finding a suitable, backwards compatible solution, which doesn't break the current command-line arguments.

Build fails for arm64 because of pip3

Seemingly, python:3-slim-buster for arm64 does not contain pip3, so the build failed:

#10 0.995 /usr/local/bin/python: can't open file '//pip3': [Errno 2] No such file or directory

Need to investigate.
/cc @mrueg

This was introduced through #17

config parameters as enviroment variables

parameters for /usr/local/homematic_exporter (esp. "ccu_host") should be configurable via enviroment variables

would be better/easier/more usual for running as a docker

Delete old devices

One of my smoke sensors is broken, therefore I replaced it with another device. In the exporter it still shows the device as reporting smoke. In the CCU Gui the device is not listed anymore because I removed it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.