BenRoe / MMM-FHEM

A module for the MagicMirror, to display data from FHEM devices.
MIT License
10 stars 14 forks source link

Can't connect to any FHEM instance #7

Open DerRheingold opened 6 years ago

DerRheingold commented 6 years ago

Hi there,

I have difficulties connecting to any FHEM instance even if they aren't password protected. As a first step I wanted to connect it to a publicly available demo environment of FHEM from https://waschto.eu/fhem-und-tabletui-livedemo/ The instance is running under "http://fhem.waschto.eu:8083/fhem"

From that instance I was trying to get the temperature and humidity reading of a device but failed. The result is, that nothing is displayed in the mirror-page.

Is there an error thrown/displayed when the connection isn't possible? Or is there any good way to debug my config? Obviously when I get this running, the next step is to connect it to my local instance. As I however need to define a new FHEMWeb for that I'd like to postpone it until the widget works fine fist :)

Hopefully someone can help me and tell me what I did wrong. Here's my config:

{
   module: 'MMM-FHEM',
   position: 'top_bar',
   config: {
      host: 'http://fhem.waschto.eu',
      port: '8083',
      https: false,
      devices: [
         { deviceName: 'FL_Temperatur',
         deviceReadings: [
            { name: 'temperature', icon: 'wi wi-thermometer', suffix: '°' },
            { name: 'humidity', icon: 'wi wi-humidity', suffix: '%' },
         ],
         }
      ],
   }
},

Thanks =)

hliebe commented 6 years ago

Have you tried to setup your host with username and password? Maybe this could solve your problem: https://github.com/BenRoe/MMM-FHEM/issues/2

Otherwise you have to debug the js code. If you want to debug the code you can use the electron dev tools. Just start the magic mirror with "npm start dev". This will start electron with opened dev tools. In the "Sources" tab you have to navigate to modules/MMM-FHEM/MMM-FHEM.js. Search for "sockeNotificationReceived: function...". At this point you can start to debug your fhem response.

PatiB87 commented 6 years ago

I have the same issue. I cannot connect to any FHEM instance. The module is not displaying anything. I can see it in the browser tools but no data is ever shown with any config connecting to any FHEM instance.

Any help (maybe someone posting his working config) is appeciated! :)

Aniflu commented 6 years ago

the Fix for you`r Problem might be:

Disable csrfToken

to test the module you can insert in the config 'header: 'Smarthome',' to see if the module is pop up an header if not the problem might be somwere else.

as an last option you can try attr WEB.* csrfToken none