FHEM Forum

FHEM => Anfängerfragen => Thema gestartet von: tur am 25 Oktober 2017, 09:27:51

Titel: Is FHEM a good choice for my project?
Beitrag von: tur am 25 Oktober 2017, 09:27:51
Hello Everyone!

[If I'm posting to a wrong forum, please point me to the correct one.]

I'm looking for a software for a home automation project with the following requirements:

- gather temperature data from 5 temperature sensors (analog or 1-wire), 1 sample per minute [corrected from originally posted requirement of 1 sample per second]
- perfrom computation on the temperature data (weighted sum)
- define a daily schedule for some controlled variable (e.g., desired temperature), for example:
  - from 05:30 to 06:00 the value should be 50
  - from 06:00 to 08:00 the value should be 40
  - from 13:00 to 14:30 the value should be 50
  - rest of the day the value should be 20
- control one appliance via a single relay, based on the computed values (weighted sum) and current value of the controlled variable

Is FHEM a good choice for such a project?

What hardware setup do you recommend? I'm planning on using either RasbperryPi or NanoPi, but haven't decided on the extension boards/modules and would welcome any suggestions.

Vielen Dank!

Regards,
Bartlomiej Sieka
Titel: Antw:Is FHEM a good choice for my project?
Beitrag von: Beta-User am 25 Oktober 2017, 09:48:39
Welcome to our forum @tur,

as FHEM is a pretty flexible solution: generally speaking it seems to be possible to achieve something that is pretty close to what you are looking for. But there are some things one should know:
First, FHEM was not designed or optimised for real time tasks. It is single threaded and - besides some exceptions - all actions are handled within one loop. So if there are other commands to be executed, this may cause some delays that may not be compatible to execute things every second.

Second, especially 1-wire temp sensors also take their time to measurements (dependent on resolution: up to 750ms). So using this type of sensors might not be compatible with your requirements, especially if you monitor the values using a blocking method.

My personal approach for such a project would be to use some kind of microcontroller (Arduino- or STM32-board) and a RTC to put all the logics on that thing. Question then would be how to monitor what is happening. This could be a good task for FHEM or you might just use a display attached directly to the mcu. But still, measuring temps every second seems to be challanging (is this really necessary?)...

Kind regards, Beta-User
Titel: Antw:Is FHEM a good choice for my project?
Beitrag von: viegener am 25 Oktober 2017, 10:07:36
I would second the statements from Beta-User:

- generally gaining sensor data every second is not necessarily a standard task for FHEM
- if fast reaction times (real time < 2 s) for steering of the appliance is needed, again this is not necessarily a FHEM task

With a dedicated microcontroller based solution you can assure realtime operation and even avoid any influence from operating system and surrounding environment/network - but clearly this requires usually programming skills.

There is no reason for not connecting the appliance/micro-controller then to FHEM for user interface/parameter setting/etc
For example in the popular heating control with homematic etc - the direct control of the heating device is done locally in the device, but steering of parameters / weekly temperatures can be done with FHEM.


Titel: Antw:Is FHEM a good choice for my project?
Beitrag von: tur am 25 Oktober 2017, 12:08:50
Thanks for the quick reply!

Regarding the measurement resolution: I made the mistake in the description of the project. I want to monitor the temperatures every minute, and even this is not a hard requirement. I can live with measurements made every couple (say max. 5) minutes.

So it seems that FHEM will work just OK for this, right?

Now, can you suggest an extension board or an add-on module for RPi for such a project?

Regards,
Bartlomiej Sieka
Titel: Antw:Is FHEM a good choice for my project?
Beitrag von: Beta-User am 25 Oktober 2017, 12:31:25
Thanks for clarification wrt. to measuring periodes; so doing things directly in FHEM should be ok (but be careful and avoid infrastructural dependencies for critical appliencies; WLAN for steering your heating without working backup solution may not be the best idea ;) ).

Given that few info it is almost impossible to give valid recommendation wrt. hardware to use. This depends on
- where to install all the things, are cables (which type) available, should the sensors be attached to tubes or meassure air temperatures? (you alread mentionned 1-wire, there are parst in this technology available to achieve all the needs you described. This will require a dedicated busmaster (typically a USB-Device)).
- what do you want to switch? E.g. in Germany, only skilled and "certified" people are allowed to do modifications to 230V installations.
- Do you have programming experience?

This type of question were alsready answered before quite often (most times in german), so I recommend to push this thread to the "english corner" and use a more descriptive title for your thread(s). You may do this yourself, the necessary options are available when you edit your first post in this thread.
Titel: Antw:Is FHEM a good choice for my project?
Beitrag von: Thorsten Pferdekaemper am 25 Oktober 2017, 12:45:09
Cesc,
I wondered a bit about the temperatures. Is this Fahrenheit or are you building something like a sauna?
Anyway, assuming that we are talking about a place in Poland, you should have normal EU plugs and 230V electricity. I.e. if you do not want to do any bricolage, you can even use Homematic. E.g. the wall thermostat gives you temperatures every about 2,5 minutes and can be peered directly with a relais actor. ("peered directly" means that it still works even if the FHEM box should crash.)
Maybe a bit cheaper and with wires, you can use Homematic Wired. There is a way to connect multiple 1-Wire temperature sensors to an arduino type microcontroller and you can also get "wired" relais modules.
Regards,
   Thorsten