-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfhem_signalduino_example.cfg
More file actions
executable file
·91 lines (83 loc) · 4.51 KB
/
fhem_signalduino_example.cfg
File metadata and controls
executable file
·91 lines (83 loc) · 4.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
attr global userattr cmdIcon devStateIcon:textField-long devStateStyle icon sortby webCmd webCmdLabel:textField-long widgetOverride
attr global autosave 0
attr global logfile log/fhem-%Y-%m-%d.log
attr global modpath .
attr global nofork 0
attr global pidfilename log/fhem.pid
attr global statefile ./log/fhem.save
attr global updateInBackground 1
attr global verbose 3
# FHEM Configuration for PySignalduino Dev Environment
#
# This file is loaded by the FHEM container via CONFIGTYPE environment variable.
# 1. Define FHEMWEB instance to access FHEM via Browser (Port 8083)
define WEB FHEMWEB 8083 global
setuuid WEB 695e9c21-f33f-c986-956a-7e26fc9adfc69728
attr WEB editConfig 1
attr WEB stylesheetPrefix dark
# 2. Define Telnet for command line access (Optional)
#define telnetPort telnet 7072 global
# 3. Basic Event Handling
define eventTypes eventTypes ./log/eventTypes.txt
setuuid eventTypes 695e9c21-f33f-c986-9ac3-190c47641a98acb9
# tag::broker_config[]
# 4. Define the MQTT Client (Broker Connection)
# 'mqtt' is the hostname of the broker service in docker-compose.yml
define mqtt_broker MQTT2_CLIENT mqtt:1883
setuuid mqtt_broker 695e9c21-f33f-c986-e617-d7301881c4685bc6
attr mqtt_broker autocreate simple
# end::broker_config[]
# tag::device_config[]
# 5. Define the SignalDuino MQTT Device
define PySignalDuino MQTT2_DEVICE
setuuid PySignalDuino 695e9c21-f33f-c986-4f81-a9f0ab37b6bcedf8
attr PySignalDuino IODev mqtt_broker
attr PySignalDuino readingList signalduino/v1/state/messages:.* { json2nameValue($EVENT, 'MSG_',$JSONMAP) }\
signalduino/v1/responses:.* { json2nameValue($EVENT, 'RESP_') }\
signalduino/v1/errors:.* { json2nameValue($EVENT, 'ERR_') }
attr PySignalDuino setList raw:textField signalduino/v1/commands/set/raw $EVTPART1 \
cc1101_reg:textField signalduino/v1/commands/set/cc1101_reg $EVTPART1 \
# System GET commands (noArg) \
version:noArg signalduino/v1/commands/get/system/version \
freeram:noArg signalduino/v1/commands/get/system/freeram \
uptime:noArg signalduino/v1/commands/get/system/uptime \
# Decoder state commands \
decoder_state:noArg signalduino/v1/commands/get/config/decoder \
decoder_ms_enable:noArg signalduino/v1/commands/set/config/decoder_ms_enable \
decoder_ms_disable:noArg signalduino/v1/commands/set/config/decoder_ms_disable \
decoder_mu_enable:noArg signalduino/v1/commands/set/config/decoder_mu_enable \
decoder_mu_disable:noArg signalduino/v1/commands/set/config/decoder_mu_disable \
decoder_mc_enable:noArg signalduino/v1/commands/set/config/decoder_mc_enable \
decoder_mc_disable:noArg signalduino/v1/commands/set/config/decoder_mc_disable \
# CC1101 GET commands (noArg) \
cc_config:noArg signalduino/v1/commands/get/cc1101/config \
cc_patable_get:noArg signalduino/v1/commands/get/cc1101/patable \
cc_register:noArg signalduino/v1/commands/get/cc1101/register \
cc_freq_get:noArg signalduino/v1/commands/get/cc1101/frequency \
cc_bandwidth_get:noArg signalduino/v1/commands/get/cc1101/bandwidth \
cc_rampl_get:noArg signalduino/v1/commands/get/cc1101/rampl \
cc_sensitivity_get:noArg signalduino/v1/commands/get/cc1101/sensitivity \
cc_datarate_get:noArg signalduino/v1/commands/get/cc1101/datarate \
cc_settings_get:noArg signalduino/v1/commands/get/cc1101/settings \
cc_deviation_get:noArg signalduino/v1/commands/get/cc1101/deviation\
# CC1101 SET commands \
cc_frequency_set:textField signalduino/v1/commands/set/cc1101/frequency $EVTPART1 \
cc_rampl_set:select,24,27,30,33,36,38,40,42 signalduino/v1/commands/set/cc1101/rampl $EVTPART1 \
cc_sensitivity_set:select,4,8,12,16 signalduino/v1/commands/set/cc1101/sensitivity $EVTPART1 \
cc_patable_set:select,-30_dBm,-20_dBm,-15_dBm,-10_dBm,-5_dBm,0_dBm,5_dBm,7_dBm,10_dBm signalduino/v1/commands/set/cc1101/patable $EVTPART1 \
cc_bandwidth_set:textField signalduino/v1/commands/set/cc1101/bandwidth $EVTPART1 \
cc_datarate_set:textField signalduino/v1/commands/set/cc1101/datarate $EVTPART1 \
cc_deviation_set:textField signalduino/v1/commands/set/cc1101/deviation $EVTPART1 \
\
# Maintenance commands \
factory_reset:noArg signalduino/v1/commands/set/factory_reset
attr PySignalDuino stateFormat state
# end::device_config[]
# Map JSON payload to readings
# Define setter commands
# Logfile for SignalDuino
define FileLog_PySignalDuino FileLog ./log/PySignalDuino-%Y.log PySignalDuino
setuuid FileLog_PySignalDuino 695e9c21-f33f-c986-1981-abe9a5a366b3c989
attr FileLog_PySignalDuino logtype text
define Logfile FileLog /opt/fhem/log/fhem-%Y-%m-%d.log Logfile
setuuid Logfile 695e9c21-f33f-c986-cfda-4915c3e60c145721