openHab random stuff:
To add extra memory rescources to openhab edit this file: I changed the 1024 bit.
sudo vi /etc/default/openhab
and add this:
EXTRA_JAVA_OPTS=”-Xms192m -Xmx1024m -XX:+ExitOnOutOfMemoryError”
I couldn’t get sudo openhab-cli console command to work.
Kept getting this error:
Logging in as openhab Failed to get the session.
To fix it I ran this:
ssh -vvv -p 8101 openhab@127.0.0.1
Then logged in this way and then after that the openhab-cli command worked.
I guess it had to reset the ssh keys as it asked me that question when logging in.
To get the broadcom rm4 unit to work you have to install the software from here: https://github.com/eschava/broadlink-mqtt
Here is the rule to make it work:
//need below to log to openhab.log fileI second split DNS
var logger = Java.type(‘org.slf4j.LoggerFactory’).getLogger(‘org.openhab.rule.’ + ctx.ruleUID);
//below is if you are going to use the execute command
var Exec = Java.type(“org.openhab.core.model.script.actions.Exec”);
//below is also needed for the execute command
var Duration = Java.type(“java.time.Duration”);
//var HttpUtil = Java.type(“org.openhab.core.io.net.http.HttpUtil”);
//var HttpGet = Java.type(“org.openhab.core.model.script.actions.HTTP”);
var TOPIC = “broadlink/heater/rinnai/”
var stateof = event.itemState.toString() ;
//logger.info(“results = ” + stateof);
result = Exec.executeCommandLine(Duration.ofSeconds(5), “/usr/bin/mosquitto_pub”,”-h”,”192.168.1.164″,”-t”,”” + TOPIC + stateof,”-m”,”replay”);
logger.info(‘The script ran the command ‘ + TOPIC + stateof);
I had to do this via the add items contextual option to get the count to work if open.
Group:Number:COUNT(OPEN) groupname “Group description”
Number Blind_1_position_counter “Blind 1 counter”
Number Blind_2_position_counter “Blind 2 counter”
Number Blind_3_position_counter “Blind 3 counter”
Number Blind_4_position_counter “Blind 4 counter”
Number Blind_5_position_counter “Blind 5 counter”
Number Blind_6_position_counter “Blind 6 counter”
Number Blind_7_position_counter “Blind 7 counter”
run this command in the openhab-cli console
ttop –stats=tid,name,state,user_time,cpu_time,user_time_perc,cpu_time_perc –order=cpu_time –millis=300
It will show you the openhab processes that are using memory etc
If you run openhab-cli and then type
openhab:status
It will show you the value of that item.
Example:
openhab:status Backupserver
OFF
P.S it IS case sensitive
Grafana URL example:
http://192.168.1.164:3000/d/a787a9b7-e4bf-4cd7-9587-974e150d1abd/water?orgId=1&viewPanel=1&from=now-{period}&to=now
The widget grafana with time ranges can use this format
http://192.168.1.164:3000/d/a787a9b7-e4bf-4cd7-9587-974e150d1abd/water?kiosk&orgId=1&viewPanel=1&from=now-{period}&to=now
to use kiosk mode add the word kiosk after the ?
and these options
1d=1 day,7d=7 days ,1M=1 month
This resets openhab back to original and items or things etc:
sudo apt -o Dpkg::Options::=”–force-confmiss” install –reinstall openhab
Longer form:
text: “=items[props.roomName+’_Humidity’].displayState”
text: =@(props.roomName + ‘_Humidity’)
This defaults to the same result as the longer form but has one extra benefit which is that it will fallback to the state value if the displayState is undefined (which happens under certain circumstances).
If there is a lot of discovered things in the inbox you can run for example:
inbox remove inbox remove mqtt:homeassistant: