npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

smartfritz

v0.1.7

Published

SmartHome for Fritz!Box and Dect!200 Node to communicate with AVM FritzBox over the aha-http-interface

Downloads

52

Readme

smartfritz

Node module to communicate with a AVM FritzBox and FRITZ!DECT 200 (smart home hardware) providing the following functions:

  • Get the session ID (getSessionID)
  • Get the switch (FRITZ!DECT 200) State (getSwitchState)
  • Set the switch (FRITZ!DECT 200) ON (setSwitchOn)
  • Set the switch (FRITZ!DECT 200) OFF (setSwitchOff)
  • Get the switch (FRITZ!DECT 200) Power (getSwitchPower)
  • Get the switch (FRITZ!DECT 200) Energy (getSwitchEnergy)
  • Get the switch (FRITZ!DECT 200) List (getSwitchList)
  • Get the DeviceListInfos (FRITZ!DECT 200) as XML (getDeviceListInfos) >FritzOS 6.10
  • Get the phone list (getPhoneList)
  • Set the guest wlan (setGuestWLan)
  • Get the guest wlan settings (getGuestWLan)

correction of package.json with main for "out of the box" function.

For AVM FRITZ!DECT 200 control you need to know your Actuator identification number (AIN)

Install

npm install smartfritz

Testing the Examples

node fritz02_devicelistinfos.js

Output similar to:
Fritz!Session ID: 171775fcb855bc17
Switches AIDs: 087610087001,087510717012,087610101971

How to use

Get the session ID default: as URL "fritz.box" is used as default paramter

var fritz = require('smartfritz');

fritz.getSessionID("user", "password", function(sid){
    console.log(sid);
});

Get the session ID with own URL: use your Fritz!Box IP when "fritz.box" is not working.

var fritz = require('smartfritz');

var moreParam = { url:"192.168.178.1" };
fritz.getSessionID("user", "password", function(sid){
    console.log(sid);
}, moreParam);

Get the Switch AID List:

var fritz = require('smartfritz');

fritz.getSessionID("user", "password", function(sid){
  
  console.log("Fritz!Session ID: "+sid);
  fritz.getSwitchList(sid,function(listinfos){
      console.log("Switches AIDs: "+listinfos);
  });

});

Get the switch Power (FRITZ!DECT 200):

var fritz = require('smartfritz');

fritz.getSwitchPower(sid, aid, function(sid){
    console.log(sid);
});

Get the switch Energy (FRITZ!DECT 200):

var fritz = require('smartfritz');

fritz.getSwitchEnergy(sid, aid, function(sid){
    console.log(sid);
});

Get the switch State (DECT200):

var fritz = require('smartfritz');

fritz.getSwitchState(sid, aid, function(sid){
    console.log(sid);
});

Set the switch State ON (DECT200):

var fritz = require('smartfritz');

fritz.setSwitchOn(sid, aid, function(sid){
    console.log(sid);
});

Set the switch State OFF (DECT200):

var fritz = require('smartfritz');

fritz.setSwitchOff(sid, aid, function(sid){
    console.log(sid);
});

Get the phone list:

var fritz = require('smartfritz');

fritz.getPhoneList(sid,function(calls){
    console.log(calls);
});

Enable or disable guest wlan:

var fritz = require('smartfritz');

fritz.setGuestWLan(sid, true, function(enabled){
    console.log("Guest WLan Enabled: "+enabled);
});

Get guest wlan settings:

var fritz = require('smartfritz');

fritz.getGuestWLan(sid, function(settings){
    console.log(settings);
});

AHA-HTTP Interface

AHA - Avm Home Interface

https://fritz.box/webservices/homeautoswitch.lua?ain=&switchcmd=&sid=

AHA-HTTP-Interface document http://avm.de/fileadmin/user_upload/Global/Service/Schnittstellen/AHA-HTTP-Interface.pdf

Thanks to // Code base from:

  • steffen.timm for the basic communication function
  • thk4711 for the FRITZ!DECT 200 codes
  • AVM for providing the good AHA-HTTP-Interface document