FHEM > Frontends

HASS mit FHEM

<< < (6/7) > >>

Wuppi68:

--- Zitat von: Christian1 am 01 Juni 2020, 23:41:53 ---Hi Ralf,

I thank you for your answer !
I am interested by your answer, because at this moment, I am drowned on how to configure MQTT , but I am determined to reach my project.
I think that I am quite close to the result, but as a beginner (that's why probably I have chosen Home Assistant), I discover too much new things (FHEM, MQTT, german ;-) ), beta-user takes the time to try to explain/help me in another threat (MQTT), but the very end is hard to reach for me :-(

Yes I need FHEM only for enocean,
So that's why I am also interested to your proposal that I have read carefully. I really would like to use this github enocean-mqtt, but I am beginner in this Unix process and the explanations are not enough acurate for me, I am pratically just able to type line by line what I need to do :-( 

For instance,
- does this enocean-mqtt already on my Raspberry PI, do I need to de something previously, on just open a terminal ?
- it asks to "download this repository to an arbritary directory" but I even don't know where the data are saved when I will write "pip install enocean-mqtt"
- I don't know if I need to setup as a daemon, as a docker container (I just know that I have installed Home Assistant in a container, and FHEM by the usual "sudo wget http://fhem.de/fhem-6.0.deb && sudo dpkg -i fhem-6.0.deb")
- I see /dev/ttyUSB0 but I use an EnOcean PI GPI so I use /dev/ttyS0 > I don't know if it is compatible ? I haven't find for the moment this parameter in the github
- In enoceanmqtt.conf.sample, some commands are # but I don't know if I need it (ssl certificate, mqtt_publish_json...), and most of all, even if I have succeeded to detect my actuator and my remote control (and to get their ID...), I don't know how to configure it into the enoceanmqtt.conf

What do you think about all that ?

Christian

--- Ende Zitat ---

sorry for the long waiting.

I only took a quick look to the git repository and it looks well. You can run it "easily" within docker. You can find the docker image here: https://hub.docker.com/r/flopon/enocean-mqtt at the "tags" tab you will find instruction to get the ready image. Or just type in "docker run flopon/enocean-mqtt" to single start this image. I don't use it. If you have further questions you can ask me to get it basically running

rizo:
Hallo liebe Leute

Ich bin gerade angefangen Home Assistant zu nutzen und Geräte von Fhem per mqtt zu "teilen".

Schalter und Schaltbare Steckdosen sind alle kein Problem gewesen.

Ich scheitere allerdings bei den Thermostaten.

Hat da jmd ein Config Beispiel?

rizo:
Niemand der helfen kann?

NecDd:
Hi @rizo,
a bit late but hope it still helps.

My config:
-Raspberry Pi @ Raspbian Lite
-Docker +Portainer
-Home Assistnat Supervised in Docker
-MQTT integration in Home Assistant
-Fhem (normaly installed)

In FHEM:
1.

--- Code: ---defmod hass_MQTT2 MQTT2_CLIENT 172.30.32.1:1883
attr hass_MQTT2 clientId fhem
attr hass_MQTT2 keepaliveTimeout 60
attr hass_MQTT2 msgAfterConnect -r fhem/connection/status connected
attr hass_MQTT2 msgBeforeDisconnect -r fhem/connection/status disconnected
attr hass_MQTT2 qosMaxQueueLength 100
attr hass_MQTT2 room MQTT
attr hass_MQTT2 username mqtt
--- Ende Code ---

IP of HA you can find it over SSH with
--- Code: ---ifconfig
--- Ende Code ---
Secure it woth a User+Pass in HA. In FHEM
--- Code: ---attr hass_MQTT2 username mqtt
--- Ende Code ---
and
--- Code: ---set hass_MQTT2 password <your_password>
--- Ende Code ---

define a MQTT Bridge in FHEM:

--- Code: ---defmod mqttGeneric MQTT_GENERIC_BRIDGE
attr mqttGeneric IODev ha_MQTT2
attr mqttGeneric event-aggregator incoming-count:120,outgoing-count:120,transmission-state:120
attr mqttGeneric globalDefaults sub:qos=2 pub:qos=0 retain=1 base={"fhem/$device"}
attr mqttGeneric globalPublish *:topic={"fhem/$device/$reading"}
attr mqttGeneric icon mqtt_bridge_2
attr mqttGeneric room MQTT
attr mqttGeneric stateFormat in: incoming-count out: outgoing-count devices: device-count
attr mqttGeneric verbose 0
--- Ende Code ---

The Thermostat (MAX!) in FHEM:

--- Code: ---defmod HT_Ba MAX HeatingThermostat 13822d
attr HT_Ba IODev CUL.MAX
attr HT_Ba model HeatingThermostat
attr HT_Ba mqttDefaults base={"$base/HT/Ba"}
attr HT_Ba mqttPublish *:topic={"fhem/$device/$reading"}
attr HT_Ba mqttSubscribe desiredTemperature:stopic={"$base/desiredTemperature"}
attr HT_Ba room MAX
--- Ende Code ---
Of course you will need a CUL or a MAX! Bridge to comunicate with it. You can use a Homematic TRV defined in FHEM, but you have to change the mqttSubscribe desiredTemperature to desired-temp.

In Home Assistant (MQTT and File editor integrations must be active):
in /config/configuration.yaml: climate: !include climate.yaml
Create a empty file climate.yaml
In climate.yaml:

--- Code: ---### 1. TRV Bathroom
- platform: "mqtt"
   name: "HT_Ba"
   retain: false
   current_temperature_topic: "fhem/HT_Ba/temperature"
   temperature_state_topic: "fhem/HT_Ba/desiredTemperature"
   temperature_command_topic: "fhem/HT_Ba/HT/Ba/desiredTemperature"
   min_temp: 5
   max_temp: 25
   temp_step: 0.5
   modes: ["auto","manual","off","boost"]
   mode_state_topic: "fhem/HT_Ba/mode"
### 1. END TRV Bathroom ################
--- Ende Code ---
For HomeMatic TRV change the reading acording to readings of the thermostat, or use MQTT.fx to find/see them.


in /config/configuration.yaml: sensor: !include sensors.yaml

In sensors.yaml:

--- Code: ---### 1 sensors TRV Bathroom ################
- platform: "mqtt"
  name: "HT_Ba valveposition"
  state_topic: "fhem/HT_Ba/valveposition"
  unit_of_measurement: "%"
#
- platform: "mqtt"
  state_topic: "fhem/HT_Ba/temperature"
  name: "HT_Ba temperature"
  unit_of_measurement: "°C"
#
- platform: "mqtt"
  name: "HT_Ba desiredTemperature"
  state_topic: "fhem/HT_Ba/desiredTemperature"
  unit_of_measurement: "°C"

- platform: "mqtt"
  name: "HT_Ba mode"
  state_topic: "fhem/HT_Ba/mode"

- platform: "mqtt"
  name: "HT_Ba battery"
  state_topic: "fhem/HT_Ba/battery"
   
--- Ende Code ---

To use the BOOST function, create a Switch:
in /config/configuration.yaml: switch: !include switch.yaml
In switch.yaml:

--- Code: ---- platform: mqtt
  name: "Ba_Boost"
  command_topic: "fhem/HT_Ba/HT/Ba/desiredTemperature"
  state_topic: "fhem/HT_Ba/mode"
  payload_on: "boost"
  payload_off: "manual"
  state_on: "boost"
  state_off: "manual"
  optimistic: true
  qos: 0
  retain: true
--- Ende Code ---

In HA, you can use Thermostat Card pointing it to the right entity. In atached picture I use "custom:simple-thermostat" Installed over HACS.

Best Regards

NecDd:
Forgot to put the config for HomeMatic TRV  (HM-CC-RT-DN):


--- Code: ---defmod HT_Bucatarie CUL_HM 21DD9F04
attr HT_Bucatarie userattr lightSceneParamsToSave lightSceneRestoreOnlyIfChanged:1,0
attr HT_Bucatarie genericDeviceType thermostat
attr HT_Bucatarie group 0_HT
attr HT_Bucatarie homebridgeMapping TargetTemperature=desired-temp::desired-temp,minValue=5,maxValue=29,minStep=0.5,nocache=1\
CurrentTemperature=HT_Bucatarie:measured-temp,nocache=1\
StatusLowBattery=TH_Bucatarie:battery,values=ok:BATTERY_LEVEL_NORMAL;;;;/^.*/:BATTERY_LEVEL_LOW\
TargetHeatingCoolingState=heatingState,values=OFF:0;;;;HEAT:1;;;;COOL:2;;;;AUTO:3,cmds=OFF:controlManu+off;;;;HEAT:controlMode+boost;;;;AUTO:controlMode+auto;;;;COOL:controlManu+17.0\
CurrentHeatingCoolingState=heatingState,values=OFF:0;;;;HEAT:1;;;;COOL:2;;;;AUTO:0,valud=OFF
attr HT_Bucatarie model HM-CC-RT-DN
attr HT_Bucatarie mqttDefaults base={"$base/HT_Bu"}
attr HT_Bucatarie mqttPublish *:topic={"fhem/$device/$reading"}
attr HT_Bucatarie mqttSubscribe desired-temp:stopic={"$base/desired-temp"} controlMode:stopic={"$base/controlMode"}
attr HT_Bucatarie peerIDs 00000000
attr HT_Bucatarie room Incalzire Centrala
attr HT_Bucatarie siriName Kitchen Heating

--- Ende Code ---

Actualy you have to take care that the mqttPub and mqttSub are diferent topics bcz you can runn in a comand loop.
Homebridge integration you don't have to use it. I use it just bcz my whife has an Iphone and she find it confortable.

HASS as a Switch for Boost:

--- Code: ---##################################
### -= BOOST=- ###################
##################################
######
- platform: mqtt
  name: "Boost_Bu"
  command_topic: "fhem/HT_Bucatarie/HT_Bu/controlMode"
  state_topic: "fhem/HT_Bucatarie/controlMode"
  payload_on: "boost"
  payload_off: "manual"
  state_on: "boost"
  state_off: "manual"
  optimistic: true
  qos: 0
  retain: true
####
--- Ende Code ---

HASS Climate:

--- Code: ---### HT Bucatarie
- platform: "mqtt"
  name: "HT_Bu"
  retain: false
  current_temperature_topic: "fhem/HT_Bucatarie/measured-temp"
  temperature_state_topic: "fhem/HT_Bucatarie/desired-temp"
  temperature_command_topic: "fhem/HT_Bucatarie/HT_Bu/desired-temp"
  min_temp: 5
  max_temp: 25
  temp_step: 0.5
  modes: ["auto","manual","off","boost"]
  mode_state_topic: "fhem/HT_Bucatarie/controlMode"
### 1. END ################
--- Ende Code ---

HASS sensors for TRV:

--- Code: ---## MQTT HT Bucatarie
- platform: "mqtt"
  name: "HT_Bu valveposition"
  state_topic: "fhem/HT_Bucatarie/ValvePosition"
  unit_of_measurement: "%"
#
- platform: "mqtt"
  name: "HT_Bu temperature"
  state_topic: "fhem/HT_Bucatarie/measured-temp"
  unit_of_measurement: "°C"
#
- platform: "mqtt"
  name: "HT_Bu desiredTemperature"
  state_topic: "fhem/HT_Bucatarie/desired-temp"
  unit_of_measurement: "°C"

- platform: "mqtt"
  name: "HT_Bu mode"
  state_topic: "fhem/HT_Bucatarie/controlMode"
## HT Bucatarie Battery State ###
- platform: "mqtt"
  name: "HT_Bu battery"
  state_topic: "fhem/HT_Bucatarie/battery"
#
# TH Bucatarie Battery Level ###
- platform: "mqtt"
  name: "TH_Bu Battery"
  state_topic: "fhem/TH_Bucatarie/batteryLevel"
  unit_of_measurement: "V"
#
--- Ende Code ---

Window sensors has to be defined as Binary Sensors:
MAX! config @HA

--- Code: ---################
#   -= Bucatarie=-   #
- platform: mqtt
  name: "Win_Bu"
  device_class: opening
  state_topic: "fhem/W_BuUP/onoff"
  payload_on: "1"
  payload_off: "0"
  qos: 0
--- Ende Code ---
HomeMatic (HM-SEC-SCO) config @HA

--- Code: ---#   -= Door Intrare=-   #
- platform: mqtt
  name: "Door_Intrare"
  device_class: opening
  state_topic: "fhem/USA/state"
  payload_on: "opened"
  payload_off: "closed"
  qos: 0
--- Ende Code ---

Navigation

[0] Themen-Index

[#] Nächste Seite

[*] Vorherige Sete

Zur normalen Ansicht wechseln