forked from iarv/meshtastic-mqtt-client
Modified example config yaml
Modified example config yaml
This commit is contained in:
@@ -2,47 +2,28 @@ MQTT:
|
||||
MQTT_ip: 192.168.XXX.XXX
|
||||
MQTT_USER: 'MQTTUSER'
|
||||
MQTT_PW: 'MQTTPASSWORD'
|
||||
HA_BINARY: 'homeassistant/binary_sensor' # MQTT topics for home assistant to automatically detect devices
|
||||
HA_SENSOR: 'homeassistant/sensor'
|
||||
HA_SWITCH: 'homeassistant/switch'
|
||||
TIME_PERIOD: 300 # Time to try to get new sensor values. Set to 0 for one time execution.
|
||||
|
||||
TOPICS:
|
||||
POWER: 'server_power_state' #This is to get the server's ON OFF state, if you don't want it just leave an empty string
|
||||
SDR_TYPES: #THESE ARE JUST EXAMPLES OF NAMES FOR THE SENSORS, ITS A DICTIONARY SO THE first part (before :) can be whatever you want, just ensure it matches the value in SDR TYPE for this description.
|
||||
1: 'server_cpu_temp'
|
||||
2: 'server_system_temp'
|
||||
3: 'server_cpu_fan'
|
||||
4: 'server_bmc_voltage'
|
||||
SERVERS:
|
||||
- IPMI_NODENAME: XXXXX
|
||||
BRAND: ASUS #THIS IS AN ASUS EXAMPLE
|
||||
IPMI_IP: 192.168.XXX.XXX
|
||||
IPMI_USER: 'SERVER IPMI USER'
|
||||
IPMI_PASSWORD: 'SERVER IPMI PASSWORD'
|
||||
SDRS:
|
||||
- SDR_TYPE: 1
|
||||
SDR_CLASS: temperature #THERE ARE THREE CLASSES - temperature fan and voltage
|
||||
SUBCLASS: MB Temp
|
||||
VALUE: 3.0
|
||||
- SDR_TYPE: 2
|
||||
SDR_CLASS: fan
|
||||
SUBCLASS: XXXX
|
||||
VALUE: XXXX
|
||||
- SDR_TYPE: XXXX
|
||||
SDR_CLASS: voltage
|
||||
SUBCLASS: XXX
|
||||
VALUE: XXX
|
||||
- IPMI_NODENAME: XXXXXXX
|
||||
BRAND: SUPERMICRO #THIS IS A SUPERMICRO EXAMPLE
|
||||
IPMI_IP: 192.168.XXX.XXX
|
||||
IPMI_USER: 'SERVER IPMI USER'
|
||||
IPMI_PASSWORD: 'SERVER IPMI PASSWORD'
|
||||
SDRS: # YOU CAN ADD ALL THE SDRS YOU WAN
|
||||
- SDR_TYPE: XXX
|
||||
VALUE: XXXX
|
||||
SDR_CLASS: XXXX
|
||||
- SDR_TYPE: XXXX
|
||||
VALUE: XXX
|
||||
SDR_CLASS: XXXX
|
||||
|
||||
MESHTASTIC:
|
||||
CHANNEL_ID: 'ShortFast' # the name of your channel
|
||||
CLIENT_ID: '12345678' #the id for your program to use
|
||||
GATEWAY_ID: '!12345678' # Your gateway's id
|
||||
COMMON_PORTS:
|
||||
- ["1", "TEXT_MESSAGE_APP"]
|
||||
- ["2", "REMOTE_HARDWARE_APP"]
|
||||
- ["3", "POSITION_APP"]
|
||||
- ["4", "NODEINFO_APP"]
|
||||
- ["5", "ROUTING_APP"]
|
||||
- ["6", "ADMIN_APP"]
|
||||
- ["7", "TEXT_MESSAGE_COMPRESSED"]
|
||||
- ["8", "WAYPOINT_APP"]
|
||||
- ["32", "REPLY_APP"]
|
||||
- ["65", "STORE_FORWARD_APP"]
|
||||
- ["66", "RANGE_TEST_APP"]
|
||||
- ["67", "TELEMETRY_APP"]
|
||||
- ["68", "ZPS_APP"]
|
||||
EXTRA_PORTS:
|
||||
- PORT_NUMBER: 260
|
||||
PORT_NAME: 'TEMPERATURE'
|
||||
HA_CLASS: temperature
|
||||
- PORT_NUMBER: 261
|
||||
PORT_NAME: 'HUMIDITY'
|
||||
HA_CLASS: humidity
|
||||
@@ -159,10 +159,6 @@ def encode_message(message,mesh_channel_id,mesh_gateway_id,mesh_client_id):
|
||||
mesh_se.gateway_id = mesh_gateway_id
|
||||
mesh_se.packet.CopyFrom(packet)
|
||||
mesh_se=mesh_se.SerializeToString()
|
||||
#print(packet)
|
||||
#mesh_se=mesh_se.encode('base64')
|
||||
|
||||
#mesh_se = mesh_se.SerializeToString()
|
||||
return mesh_se
|
||||
except Exception as exception:
|
||||
logging.critical(f'There was an error encoding you message. You get the following error: {exception} ')
|
||||
@@ -189,7 +185,6 @@ def check_id(mesh_node_id):
|
||||
logging.critical(f' There was a problem getting your node id. The exception is: {exception} ')
|
||||
def save_full_message(full_message,mesh_node_id):
|
||||
try:
|
||||
#full_message=re.escape(full_message)
|
||||
node_id = check_id(mesh_node_id)
|
||||
con = sl.connect('config/meshtastic-mqtt-client.db')
|
||||
cur = con.cursor()
|
||||
|
||||
Reference in New Issue
Block a user