Commit Graph

81 Commits

Author SHA1 Message Date
Jarno Rankinen 5fddc0dcb7 gh-10 Method for writing a single coil 2023-02-23 22:07:51 +02:00
Jarno Rankinen 1759dabbca gh-6 Found coil for overpressure (3) by experimenting, fix HA status logic 2023-02-23 20:42:00 +02:00
Jarno Rankinen b1aa71e5c7 gh-6 Updated Home Assistant configuration files for room temperature 2023-02-23 20:09:33 +02:00
Jarno Rankinen 1b1a9c75ea gh-6 Panel room temperature reading for Home Assistant status, comments 2023-02-23 20:08:47 +02:00
Jarno Rankinen 1f5a258937 gh-6 Add operating mode to HASS YAMLs 2023-02-19 22:51:57 +02:00
Jarno Rankinen aba5156e7a gh-6 Device operating mode parsed from bitfield. Bitfields are now 16 bits long, as they should be 2023-02-19 22:34:34 +02:00
Jarno Rankinen ea00590e33
Merge pull request #15 from 0ranki/dependabot/pip/enervent-ctrl-python/werkzeug-2.2.3
Bump werkzeug from 2.2.2 to 2.2.3 in /enervent-ctrl-python
2023-02-19 21:29:54 +02:00
Jarno Rankinen 175254b4ba gh-16 Retry reading registers 5 times, added debug variable to PingvinKL.New(). Not much debug output yet. 2023-02-19 21:28:50 +02:00
Jarno Rankinen ea148e5a38 Fix copy-paste mistake in HASS yamls 2023-02-19 12:31:59 +02:00
Jarno Rankinen e30c83c96a gh-10 Background updates for data 2023-02-19 12:28:26 +02:00
Jarno Rankinen f36c2b4f17 gh-6 Home Assistant sensors and dashboard example YAMLs, finnish and english versions 2023-02-19 11:39:47 +02:00
Jarno Rankinen d3c2dd5de3 gh-6 All the simpler values for /status endpoint implemented. Alarms, op mode, uptime&date will be in separate functions 2023-02-18 22:18:37 +02:00
Jarno Rankinen 9fefef8a98 gh-6 the update/populate functions now work on the struct they're a member of, instead of on a copy. Added /api/v1/status route 2023-02-18 21:52:53 +02:00
Jarno Rankinen 960c29fbf4 #6 Include raw data multiplier in register struct 2023-02-18 21:06:02 +02:00
Jarno Rankinen 337581be66 #6 Data structures for /status endpoint 2023-02-18 19:37:43 +02:00
Jarno Rankinen cd57adfb6a gh-5 Fix hide/show reserved checkbox inverted 2023-02-16 14:20:27 +02:00
dependabot[bot] 2aadecd501
Bump werkzeug from 2.2.2 to 2.2.3 in /enervent-ctrl-python
Bumps [werkzeug](https://github.com/pallets/werkzeug) from 2.2.2 to 2.2.3.
- [Release notes](https://github.com/pallets/werkzeug/releases)
- [Changelog](https://github.com/pallets/werkzeug/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/werkzeug/compare/2.2.2...2.2.3)

---
updated-dependencies:
- dependency-name: werkzeug
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-16 07:20:35 +00:00
Jarno Rankinen a4fcbdc2ed gh-14 Tests for newRegister 2023-02-12 22:55:58 +02:00
Jarno Rankinen b8929f6211 gh-14 Test coil.Reserved assignment 2023-02-12 22:37:23 +02:00
Jarno Rankinen 480279e2f5 gh-14 Unit testing for pingvinKL.newCoil, test.sh for executing tests 2023-02-12 22:31:21 +02:00
Jarno Rankinen f204aeb4ad close gh-1 Added checkbox for showing/hiding reserved coil/register values 2023-02-12 14:30:25 +02:00
Jarno Rankinen 0baf86c67f gh-5 Update datatable on coil/register status pages instead of appending to it 2023-02-12 13:42:11 +02:00
Jarno Rankinen e780ced158
Update README.md 2023-02-08 20:45:27 +02:00
Jarno Rankinen afa8f936b1
Update add_to_project.yml
Fix typo
2023-02-08 19:55:28 +02:00
Jarno Rankinen d530ff2876
Add_to_project action 2023-02-08 19:46:51 +02:00
Jarno Rankinen f851bf44a7 Added comment about building to main.go 2023-02-02 13:38:31 +02:00
Jarno Rankinen 21bfe7a9d5 gh-5 Show bitfields correctly again
Bump version to 0.0.3
2023-02-02 13:31:24 +02:00
Jarno Rankinen 64e3a4811a gh-5 Use dom manipulation for coils as well 2023-02-02 13:25:40 +02:00
Jarno Rankinen c29692ae3e gh-5 Improved JS render performance
Dramatically improved web table render time by using dom
manipulation instead of string concatenation for generating the
data table
2023-02-02 13:10:30 +02:00
Jarno Rankinen 5d23e34f44 Include static files in build
Building requires replacing symlinks under static/ with the target file
contents.
2023-02-02 11:44:34 +02:00
Jarno Rankinen 48bdfd691b gh-5 Proper handling of bitfield data type 2023-02-02 00:07:36 +02:00
Jarno Rankinen 1080219b23 gh-5 Handle unsigned & signed values
updateRegisters now handles signed values correctly. Bitfields and
enumerations are still interpreted as unsigned values
2023-02-01 23:09:50 +02:00
Jarno Rankinen 2758f67299 gh-5 Debug/other output 2023-02-01 22:19:57 +02:00
Jarno Rankinen 3990a0a833 gh-5 Register API route somewhat works now
Internal data handling needs much improvement, as signed/unsigned
integers and other data types are not yet handled.

Javascript seems like a really poor choice for parsing the html
table, currently it takes ~10 seconds to hande the data. API
response time is good, so probably switching to Go templates for
the dynamic tables is the best course of action. This will move
the load from clientside to serverside, hopefully the planned
RPi Zero W can handle the computations
2023-02-01 22:12:56 +02:00
Jarno Rankinen 81a7e5cb22 Serve everything from the binary instead of Nginx. Missing TLS, but that may not be a requirement at all 2023-02-01 21:52:55 +02:00
Jarno Rankinen 7eb75541d3 gh-5 Commenting 2023-02-01 00:04:13 +02:00
Jarno Rankinen f4eb787a10 gh-5 Fetch register data from bus
- goburrow/modbus' ReadHoldingRegisters can only fetch 125 registers at a
time, so updateRegisters does several readings
- modbus.ReadHoldingRegisters returns a []byte, where each even byte represents
  the MSB of a int16/uint16 and every odd byte is the LSB
- updateRegisters loops through each response slice forming the 16-bit
  integers

Still need to figure out a way to properly handle the signed/unsigned
values, and also the enumerations and bitfields. Perhaps changing the
'signed' boolean to a byte and making that a bitfield representing the
value type would be a good way to go. The value can then be properly
formed when fetching it from the in-memory pingvinKL struct, while being
stored as an int(64) internally.
2023-02-01 00:03:47 +02:00
Jarno Rankinen 9f2d4b0c29 gh-5 Register data structure
Created preliminary struct for register data, create hreg slice
based on registers.csv
2023-01-31 23:01:09 +02:00
Jarno Rankinen 76d7dd424d #5 Remove extra newlines from registers.csv 2023-01-31 22:59:55 +02:00
Jarno Rankinen 1a8cfe891d gh-5 Created registers.csv from Enervent provided xlsx, change csv delimiter to semicolon 2023-01-31 22:57:14 +02:00
Jarno Rankinen a3bb7aa22e #10 /api/v1/coils content-type to application/json 2023-01-29 23:43:36 +02:00
Jarno Rankinen c45af6d1dd Tidy up log error output 2023-01-29 23:34:43 +02:00
Jarno Rankinen c16f94c6d4 Closes #9 Update coil values on startup. #10 /api/v1/coils route started 2023-01-29 23:31:21 +02:00
Jarno Rankinen 876123e518 #9 Mutex locking for bus operations 2023-01-29 22:09:37 +02:00
Jarno Rankinen 8143414c39 #9 Function to update all coil values 2023-01-29 21:56:22 +02:00
Jarno Rankinen 3fab63f60f #9 Go: Get single coil 2023-01-29 14:42:03 +02:00
Jarno Rankinen 7a8a7ec7bb Python: Fix Lock import 2023-01-29 14:41:25 +02:00
Jarno Rankinen ddfbc4610d Initial steps of go implementation, prime coil data from CSV file 2023-01-28 23:28:37 +02:00
Jarno Rankinen f9035d64c7 Use Lock() instead of Semaphore() 2023-01-20 13:02:52 +02:00
Jarno Rankinen 843cda4b6d Only log bg data update if debug==True 2023-01-18 23:29:08 +02:00