Websocket Monitor for door sensors

This commit is contained in:
2024-12-17 23:24:19 -05:00
parent a5725edb36
commit 7a71b0c216
8 changed files with 75 additions and 7 deletions

View File

@@ -2,7 +2,7 @@ const axios = require('axios')
const fs = require('fs')
let config = JSON.parse(fs.readFileSync('config.json', 'utf8'))
axios.get(config.servers.deconz.url + '/api/' + config.servers.deconz.apiKey + '/sensors')
axios.get(`http://${config.servers.deconz.url}:${config.servers.deconz.apiPort}/api/${config.servers.deconz.apiKey}/sensors`)
.then(response => {
// console.log(response.data)
fs.writeFileSync('devices.json', JSON.stringify(response.data, null, 2))