https://github.com/thkl/hm-interface
https://github.com/thkl/hm-interface
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/thkl/hm-interface
- Owner: thkl
- Created: 2020-12-23T11:22:21.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-07-25T12:58:12.000Z (almost 5 years ago)
- Last Synced: 2025-07-04T21:27:23.641Z (about 1 year ago)
- Language: JavaScript
- Size: 189 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This is a node implementation for an eq3 CCU Hardware Interface
Usage
npm install hm-interface
```
const HMInterface = require('hm-interface')
let options = {
localIp: 'XXX.XXX.XXX.XXX', // The IP the interface should listen to
localPort: XXXX, // the port
ccuIP: 'AAA.AAA.AAA.AAA' // The ip from your ccu ; this is needed to change the rega init urls
}
let newInteface = new HMInterface.HomematicInterface(options)
newInteface.init()
// the interface will save XMPRPC Init IDs to use after an relaunch; if you want to use saved IDs
// (you do not have to restart rega) you can do it by :
newInteface.loadClients(options.ccuIP)
// Load a device definition and create a device
let devData = require(path.join(__dirname, 'HM-LC-Sw1-Pl.json'))
let switchDevice = newInteface.initDevice('Example', 'ABCD001234', 'HM-LC-Sw1-Pl', devData)
// Message when the interface will change the value
newInteface.on('event_device_channel_value_change', (changedObject) => {
console.log('Device Value Change Event', JSON.stringify(changedObject))
})
// Message when rega will change the value
newInteface.on('device_channel_value_change', (changedObject) => {
console.log('Device Value Change bySetValue', JSON.stringify(changedObject))
})
````
for more see the example
You have to add the interface to your CCU by adding it to /etc/config/InterfacesList.xml
Just add: (IP and Port see the example above)
```
myFirstInterface
xmlrpc://XXX.XXX.XXX.XXX:XXXX
myFirstInterface
```