Skip to content

Instantly share code, notes, and snippets.

@sofar
Created May 24, 2019 05:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sofar/aef6c8a652ab881f86951db47aa46219 to your computer and use it in GitHub Desktop.
Save sofar/aef6c8a652ab881f86951db47aa46219 to your computer and use it in GitHub Desktop.
MOFI450 Homeassistant configuration.yaml sensors
sensor:
- platform: snmp
host: 192.168.10.1
version: 2c
baseoid: .1.3.6.1.2.1.2.2.1.8.8
name: MOFI4500
accept_errors: true
- platform: snmp
host: 192.168.10.1
version: 2c
name: LTE Mode
baseoid: .1.3.6.1.4.1.88888.1.1.16.1.1.1.101.1
accept_errors: true
- platform: snmp
host: 192.168.10.1
version: 2c
name: LTE Band
baseoid: .1.3.6.1.4.1.88888.1.1.16.1.1.2.101.1
accept_errors: true
- platform: snmp
host: 192.168.10.1
version: 2c
name: LTE RSSI
unit_of_measurement: 'dB'
baseoid: .1.3.6.1.4.1.88888.1.1.16.1.1.3.101.1
accept_errors: true
value_template: '{{value | float}}'
- platform: snmp
host: 192.168.10.1
version: 2c
name: LTE RSRQ
unit_of_measurement: 'dB'
baseoid: .1.3.6.1.4.1.88888.1.1.16.1.1.4.101.1
accept_errors: true
value_template: '{{value | float}}'
- platform: snmp
host: 192.168.10.1
version: 2c
name: LTE RSRP
unit_of_measurement: 'dB'
baseoid: .1.3.6.1.4.1.88888.1.1.16.1.1.5.101.1
accept_errors: true
value_template: '{{value | float}}'
- platform: snmp
host: 192.168.10.1
version: 2c
name: LTE Carrier
baseoid: .1.3.6.1.4.1.88888.1.1.16.1.1.6.101.1
accept_errors: true
@phblj
Copy link

phblj commented Aug 12, 2020

This is a really helpful gist. Thanks for posting.

Did you have to change the snmpd config on the MOFI to get it to report the RSRQ/RSRP values?

@sofar
Copy link
Author

sofar commented Aug 13, 2020

@phblj I wouldn't remember - it's been a while and running great except for SNMP counter rollover not handled by hass.

here's the config on the device, so you can compare:

# This must stay here to turn on and off
config snmp global
	option enabled '1'
	option wanaccess '0'

config agent
	option agentaddress UDP:161

config com2sec public
	option secname ro
	option source default
	option community public

config com2sec private
	option secname rw
	option source localhost
	option community private

config group public_v1
	option group public
	option version v1
	option secname ro

config group public_v2c
	option group public
	option version v2c
	option secname ro

config group public_usm
	option group public
	option version usm
	option secname ro

config group private_v1
	option group private
	option version v1
	option secname rw

config group private_v2c
	option group private
	option version v2c
	option secname rw

config group private_usm
	option group private
	option version usm
	option secname rw

config view all
	option viewname all
	option type included
	option oid .1

config access public_access
	option group public
	option context none
	option version any
	option level noauth
	option prefix exact
	option read all
	option write none
	option notify none

config access private_access
	option group private
	option context none
	option version any
	option level noauth
	option prefix exact
	option read all
	option write all
	option notify all

config system
	option sysLocation	'office'
	option sysContact	'MofiNetwork'
	option sysName		'MOFI4500'
#	option sysServices	72
#	option sysDescr		'adult playground'
#	option sysObjectID	'1.2.3.4'

config exec 
        option name     lte_mode
        option prog     /usr/sbin/mofi_snmp.sh
        option args     "lte_mode"  
        option miboid   "1.3.6.1.4.1.88888.1.1.16.1.1.1"

config exec 
        option name     lte_band
        option prog     /usr/sbin/mofi_snmp.sh
        option args     "lte_band"  
        option miboid   "1.3.6.1.4.1.88888.1.1.16.1.1.2"

config exec 
        option name     lte_rssi
        option prog     /usr/sbin/mofi_snmp.sh
        option args     "lte_rssi"  
        option miboid   "1.3.6.1.4.1.88888.1.1.16.1.1.3"

config exec 
        option name     lte_rsrq
        option prog     /usr/sbin/mofi_snmp.sh
        option args     "lte_rsrq"  
        option miboid   "1.3.6.1.4.1.88888.1.1.16.1.1.4"

config exec 
        option name     lte_rsrp
        option prog     /usr/sbin/mofi_snmp.sh
        option args     "lte_rsrp"  
        option miboid   "1.3.6.1.4.1.88888.1.1.16.1.1.5"

config exec 
        option name     lte_current_carrier
        option prog     /usr/sbin/mofi_snmp.sh
        option args     "lte_current_carrier"  
        option miboid   "1.3.6.1.4.1.88888.1.1.16.1.1.6"

config exec
	option name	filedescriptors
	option prog	/bin/cat
	option args	/proc/sys/fs/file-nr
#	option miboid	1.2.3.4

@phblj
Copy link

phblj commented Aug 14, 2020

This is perfect. Thanks so much!

@GrahamOB
Copy link

GrahamOB commented Mar 8, 2022

I used your MOFI SNMP config today. Worked great, thanks for posting.

@brooksben11
Copy link

Just set this up for my system as well; will be great for aiming my external antenna in the RV. Thanks a ton for posting!

Couple questions that maybe someone can answer for me. What do the values for both the 'MOFI4500' and 'LTE Carrier' actually mean/correspond to? For me, the MOFI4500 sensor is "2" and the Carrier is "2]". I don't currently have an activated SIM card in it since we're not on the road currently, so this could also be affecting the values...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment