Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added some devices #38

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CCU_HOST=ccu3.local
CCU_USER=user
CCU_PASS=password
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
__pycache__/
.env

21 changes: 21 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
version: "3"

#networks:
# traefik:
# external: true

services:
homematic-exporter:
build: .
#image: sfudeus/homematic_exporter
image: homematic_exporter
restart: unless-stopped
# networks:
# - traefik
ports:
- 8010:8010
command: --ccu_host "$CCU_HOST" --ccu_user "$CCU_USER" --ccu_pass "$CCU_PASS" --debug
# labels:
# - traefik.enable=true
# - traefik.port=8010
13 changes: 12 additions & 1 deletion exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ class HomematicMetricsProcessor(threading.Thread):
'HM-WDS30-OT2-SM',
'HM-WDS40-TH-I',
'HM-WDS40-TH-I-2',
'HmIP-BDT', # Homematic IP Dimmaktor für Markenschalter, Unterputzmontage
'HmIP-DBB', # Homematic IP Türklingeltaster
'HMIP-eTRV', # Homematic IP Heizkörperthermostat
'HmIP-eTRV-B1', # Homematic IP Heizkörperthermostat - basic
'HmIP-SRH', # Homematic IP Fenster-/ Drehgriffkontakt
'HMIP-WRC2', # Homematic IP Wandtaster 2-fach
'HmIP-WRC6', # Homematic IP Wandtaster 6-fach
'HMIP-WTH', # Homematic IP Wandthermostat
]

# A list with channel numbers for devices where getParamset
Expand Down Expand Up @@ -220,15 +228,18 @@ def generate_metrics(self):
paramDesc = paramsetDescription.get(key)
paramType = paramDesc.get('TYPE')
if paramType in ['FLOAT', 'INTEGER', 'BOOL']:
logging.debug("Found {}: desc: {} key: {}".format(paramType, paramDesc, paramset.get(key)))
self.process_single_value(devAddress, devType, devParentAddress, devParentType, paramType, key, paramset.get(key))
elif paramType == 'ENUM':
logging.debug("Found {}: desc: {} key: {}".format(paramType, paramDesc, paramset.get(key)))
self.process_enum(devAddress, devType, devParentAddress, devParentType,
paramType, key, paramset.get(key), paramDesc.get('VALUE_LIST'))
elif paramType in ['ACTION', 'STRING']:
logging.debug("Ignoring unsupported paramType {}, desc: {}, key: {}".format(paramType, paramDesc, paramset.get(key)))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you explicitly want to log these paramTypes when they'd be logged in else anyway?

else:
# ATM Unsupported like HEATING_CONTROL_HMIP.PARTY_TIME_START,
# HEATING_CONTROL_HMIP.PARTY_TIME_END, COMBINED_PARAMETER or ACTION
logging.debug("Unknown paramType {}, desc: {}, key: {}".format(paramType, paramDesc, paramset.get(key)))
logging.debug("Unknown unsupported paramType {}, desc: {}, key: {}".format(paramType, paramDesc, paramset.get(key)))

if paramset:
logging.debug("ParamsetDescription for {}".format(devAddress))
Expand Down