Giter Club home page Giter Club logo

fritz-homeautomation-csharp's Introduction

fritz-homeautomation-csharp's People

Contributors

linariii avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

irame

fritz-homeautomation-csharp's Issues

Help with reading out DECT 440 (humidity)

So far I have been using this great library to read the temperature of a DECT 200.
Now I have another Fritz DECT 440 and would like to read out the humidity too.
Does anyone have an example code or can help me a little?
I would be very pleased! Thanks

I'm using this for temperature (same as DECT 200):
var myTemp = await FritzClient.GetTemperature(SessionID, AIN).ConfigureAwait(false);

Empty response for unplugged DECT device

When calling the method "GetDevices" I get empty xml elements for my DECT 200. My guess is that the device is currently unplugged (but still in the list of devices).

The device part of the response looks as follows:
<device identifier="08761 0348868" id="17" functionbitmask="35712" fwversion="04.25" manufacturer="AVM" productname="FRITZ!DECT 200"> <present>0</present> <txbusy>0</txbusy> <name>Lavalampe</name> <switch> <state></state> <mode></mode> <lock></lock> <devicelock></devicelock> </switch> <simpleonoff> <state></state> </simpleonoff> <powermeter> <voltage></voltage> <power></power> <energy></energy> </powermeter> <temperature> <celsius></celsius> <offset></offset> </temperature> </device>

If I manually remove this part from the response before the deserialization, everything works fine. The issue seems to be the that it can't parse the empty value to one of the enum values (like State, Mode...). Possible solution could also be a default value?

Besides that: Thanks for this library, really great work :)

Responses contain an XML serialization error...

Hello,

I have a FritzBox Cable and a Fritz Dect 210 registered there. Requesting the session ID is successfull but requesting devices with GetDevices(...) or GetDeviceInfos(...) using this requested session ID gives me an XML serialization error.

    private async Task RunFritz()
    {
        try
        {
            var homeAutomationClient = new Fritz.HomeAutomation.HomeAutomationClient();

            var sessionId = await homeAutomationClient.GetSessionId("myUserName", "myPassword");

            var devices = await  homeAutomationClient.GetDevices(sessionId);

            var info = await homeAutomationClient.GetDeviceInfos(sessionId, "myFritzDectAid");
        }
        catch(Exception ex)
        {

        }
    }

Error: "Instance validation error: 'manuell' is not a valid value for SwitchMode."

If I run the request urls in the browser I get the right XML response, e.g.:

http://fritz.box/webservices/homeautoswitch.lua?sid=68986fb1a557923b&switchcmd=getdevicelistinfos

<devicelist version="1" fwversion="7.57">
<device identifier="11657 0760001" id="16" functionbitmask="35712" fwversion="04.25" manufacturer="AVM" productname="FRITZ!DECT 210">
<present>1</present>
<txbusy>0</txbusy>
<name>FRITZ!DECT 210 #1</name>
<switch>
<state>1</state>
<mode>manuell</mode>
<lock>0</lock>
<devicelock>0</devicelock>
</switch>
<simpleonoff>
<state>1</state>
</simpleonoff>
<powermeter>
<voltage>232781</voltage>
<power>0</power>
<energy>0</energy>
</powermeter>
<temperature>
<celsius>220</celsius>
<offset>0</offset>
</temperature>
</device>
<group synchronized="0" identifier="grp8FD40C-3F744C05E" id="900" functionbitmask="37504" fwversion="1.0" manufacturer="AVM" productname="">
<present>1</present>
<txbusy>0</txbusy>
<name>Solar</name>
<switch>
<state>0</state>
<mode>manuell</mode>
<lock>0</lock>
<devicelock>0</devicelock>
</switch>
<simpleonoff>
<state>0</state>
</simpleonoff>
<powermeter>
<voltage>232781</voltage>
<power>0</power>
<energy>0</energy>
</powermeter>
<groupinfo>
<masterdeviceid>0</masterdeviceid>
<members>16</members>
</groupinfo>
</group>
</devicelist>

As you can see this mode is not part of your SwitchMode enums and additionally localised as German. Maybe you cannot use mode/SwitchMode as enum?!

I do not really know what to do or what the problem is. Could you give me some advice?

Thanks.
Sebastian.

XML serialisation error

When listing my devices, I get an XML serialisation errors

  1. Temperature.Offset is defined as uint but may be negative (int works fine)
  2. the enum SwitchMode contains Off ("0"), On ("1") and Auto ("auto") but should be Auto ("auto") and Manuell ("manuell")

I've exchanged the DLL in my copy of com.linariii.fritzsmarthome.streamDeckPlugin and now that too works fine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.