15 lines
359 B
JavaScript
15 lines
359 B
JavaScript
const HomeAssistant = require('homeassistant');
|
|
const hass = new HomeAssistant({
|
|
host: 'http://192.168.4.5',
|
|
port: 8123,
|
|
token: process.env.homeAssistantKey,
|
|
|
|
ignoreCert: false
|
|
});
|
|
async function main() {
|
|
console.log(process.env.homeAssistantKey)
|
|
t = await hass.states.get('switch', 'migenie_water_switch')
|
|
console.log(t)
|
|
}
|
|
|
|
main() |