sfudeus / homematic_exporter Goto Github PK
View Code? Open in Web Editor NEWPrometheus exporter for homematic ccu3
License: Apache License 2.0
Prometheus exporter for homematic ccu3
License: Apache License 2.0
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}
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...
Failing docker builds currently aren't noticed before being merged to master.
PR should trigger a non-pushing docker build.
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
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"
}
}
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 :)
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?
Currently, the list of supported devices is hardcoded. It should be configurable.
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.
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
what am I doing from?
Best
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).
Hi,
just tried to use your exporter with the outdoor sensor mentioned above. Works like a charm :)
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
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.
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
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.