-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request - relay control based on selectable temperature sensor #721
Comments
Not sure if this is of any help, but here is a dbus service to control a relay based on temperature probes. Very similar to the Pump dbus service. I also copied the test harness from the pump service and it passes! I also modified the velib_python file vedbus.py to use /Mgmt rather than /management I have enumerated the relays so it can be applied to either relay 1 or 2. If this can be used to speed up delivery a number of people in the community would be very pleased. |
Further to my previous comment attached is a opkg package that will modify the system allowing temperature control of the relays. It also includes some changes to the dbus-digitalinputs to support input types from a BMS for Allow to Charge, Allow to Discharge and Pre Alarm. The relay can be associated with any temperature source, either an analogue temperature input or a battery monitor providing /Dc/0/Temperature. Once installed the files for the dbus-temperatureSwitch are located in /data/local/dbus-temperatureSwitch. This monitors a temperature sensor and triggers the relay, much in the same was as the dbus-pump. Diff files for the QML GUI files are in /data/local/MB-Modifcations as well as a diff for dbus-digitalinputs. I have tested on a Cerbo and a Raspberry Pi. If this is of use please do use. MB-Modifications_0.1_cortexa7hf-neon-vfpv4.ipk.zip My test Raspberry Pi is available through VRM if you wish to log in and sniff around without actually installing the code yourselves. |
This feature has been implemented and added to the ToDo for including it in Venus. The implementation supports two conditions per temperature sensor where each one consist on a temperature range (high or low) where the configured relay must be closed. For example a temperature sensor in the battery cabinet can be used to switch on a fan in case of high temperature or a resistor to keep a Lithium battery above the cut-off temperature: Condition 1 Condition 2 Both conditions can be set to activate the same relay. This might be useful to switch on an air conditioner (set to auto) in case of high or low temperatures. Multiple sensors can control the same relay. Relay will keep closed as long as there are one active condition of any sensor. Conditions can be configured in two places.
|
Great! |
@jepefe What has to be done to use this with the internal CPU temp sensor from the Pi4 or a DS18B20 1-wire sensor. |
This should be better discussed in the community forum. I recall seeing a mod to make the RPI temp sensor visible. I tried it and worked fine but has not been upgraded for V2.80 (Python 3). |
Hi @kwindrem, I have no problem with the ad. I've already adjusted the mod. See forum: So, they are displayed as they should, but unfortunately I cannot control relays with the sensors. I'm not sure if this is only intended for the RuuviTags. |
Made a couple of tweaks to LHardwick's code to:
The second problem was that the dbus service name included a dash (-) which caused com.victronenergy.temprelay to crash. Changed the - to _ and the alarm settings show up in the CPU temp sensor Setup menu. |
Great, works. I hadn't thought of a change for Python2 and Python3. Will become obsolete after an update to Venus> v2.80. What error are you seeing here?
I had to activate it again to read my DS18B20. This library is normally not included and must be installed later. |
The error was that the import file could not be found but that makes sense based on your explanation. I wrapped a try: except: pass around the import statement so it no longer fails: Here's my setup script that uses SetupHelper if you are interested: You should be able to add the missing bits for the w1... stuff To make this work with auto download and install, it needs to be available on GitHub. I generally set up a 'latest' tag for the most recent released version but that's optional. The branch/tag in PackageManager can simply be set to 'main'. You may wish to change the package name back to what you are using now. |
Much like how you can start a pump using the relay based on a tank level sensor reading,
Would be nice if you could open or close the relay based on a temperature reading.
For example, if temp gets >30 degrees, start the air conditioner or fans, until temp drops below 25 degrees.
Of course - this can already be done via Node Red (sort of).
The text was updated successfully, but these errors were encountered: