Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.

getWindowOpen and FritzOS 7 #8

Open
delta2308151984 opened this issue Sep 12, 2018 · 7 comments
Open

getWindowOpen and FritzOS 7 #8

delta2308151984 opened this issue Sep 12, 2018 · 7 comments

Comments

@delta2308151984
Copy link

I´ve updated my FritzBox 7490 to OS 7.01 and the getWindowOpen function don´t work anymore. It´s just getting false.

In the example.js Raw devices section it is getting the correct windowopenactiv: 1 state

@andig
Copy link
Owner

andig commented Sep 13, 2018

That looks like either a UI bug or a functionality change. The table is no longer displaying the window open icon:

screen shot 2018-09-13 at 15 05 31

The raw device output has also changed:

[ { identifier: '119340326786-1',
    id: '2000',
    functionbitmask: '8208',
    fwversion: '0.0',
    manufacturer: '0x0feb',
    productname: 'HAN-FUN',
    present: '1',
    name: 'no name',
    etsiunitinfo: { etsideviceid: '406', unittype: '514', interfaces: '256' },
    alert: { state: '1' } },
  { identifier: '119340326786',
    id: '406',
    functionbitmask: '1',
    fwversion: '00.00',
    manufacturer: '0x0feb',
    productname: 'HAN-FUN',
    present: '1',
    name: 'HAN-FUN #1' } ]

Instead of the HANFUN device there is now device plus one entry per function.

I'm wondering if this complexity should be hidden in terms of supporting multiple FritzOS versions:

  • try AIN as HAN function first?
  • find window sensor for matching AIN?
  • use UI fallback as last resort?

I'll see if I can draft something.

@delta2308151984
Copy link
Author

The icon is still shown in the UI.
smarthome

smarthome_icon

@andig
Copy link
Owner

andig commented Sep 13, 2018

So, without adding another API and utilizing lodash you could do something like:

getDevice(sid, ain).then(device => +_.get(device, ['alert', 'state']));

Would that work for you?

@delta2308151984
Copy link
Author

delta2308151984 commented Sep 13, 2018 via email

@andig
Copy link
Owner

andig commented Sep 13, 2018

Gegenfrage- wo hast Du es denn überhaupt eingebaut und wie? Dann zeige ich Dir der Einfachheit halber wie das zu verändern wäre.

@andig
Copy link
Owner

andig commented Sep 14, 2018

Autsch ;) Das müsste dann so aussehen:

fritz.getDevice(sid, '099950013169').then(function(device) {
	var status = +device.alert.state ? "auf" : "zu";
	console.log("Fenster " + status);
});

@delta2308151984
Copy link
Author

delta2308151984 commented Sep 14, 2018 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants