-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from mhzawadi/dev-php
271/PHP rewrite
- Loading branch information
Showing
29 changed files
with
2,595 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.git | ||
.github | ||
mqtt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# ---> PhpStorm | ||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm | ||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 | ||
|
||
# User-specific stuff: | ||
.idea/**/workspace.xml | ||
.idea/**/tasks.xml | ||
.idea/dictionaries | ||
|
||
# Sensitive or high-churn files: | ||
.idea/**/dataSources/ | ||
.idea/**/dataSources.ids | ||
.idea/**/dataSources.xml | ||
.idea/**/dataSources.local.xml | ||
.idea/**/sqlDataSources.xml | ||
.idea/**/dynamic.xml | ||
.idea/**/uiDesigner.xml | ||
|
||
# Gradle: | ||
.idea/**/gradle.xml | ||
.idea/**/libraries | ||
|
||
# CMake | ||
cmake-build-debug/ | ||
|
||
# Mongo Explorer plugin: | ||
.idea/**/mongoSettings.xml | ||
|
||
## File-based project format: | ||
*.iws | ||
|
||
## Plugin-specific files: | ||
|
||
# IntelliJ | ||
/out/ | ||
|
||
# mpeltonen/sbt-idea plugin | ||
.idea_modules/ | ||
|
||
# JIRA plugin | ||
atlassian-ide-plugin.xml | ||
|
||
# Cursive Clojure plugin | ||
.idea/replstate.xml | ||
|
||
# Ruby plugin and RubyMine | ||
/.rakeTasks | ||
|
||
# Crashlytics plugin (for Android Studio and IntelliJ) | ||
com_crashlytics_export_strings.xml | ||
crashlytics.properties | ||
crashlytics-build.properties | ||
fabric.properties | ||
|
||
.DS_Store | ||
|
||
### PhpStorm Patch ### | ||
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 | ||
|
||
# *.iml | ||
# modules.xml | ||
# .idea/misc.xml | ||
# *.ipr | ||
|
||
# Sonarlint plugin | ||
.idea/sonarlint | ||
vendor | ||
data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM alpine:3.17 | ||
MAINTAINER Matthew Horwood <[email protected]> | ||
|
||
# Install required deb packages | ||
RUN apk update && apk upgrade && \ | ||
apk add php81-json php81-curl git php81 php81-phar php81-xml php81-tokenizer \ | ||
php81-sockets curl php81-openssl php81-mbstring php81-dom php81-xmlwriter \ | ||
&& rm -f /var/cache/apk/*; \ | ||
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ | ||
php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \ | ||
php composer-setup.php && \ | ||
php -r "unlink('composer-setup.php');" && \ | ||
mv composer.phar /usr/local/bin/composer; | ||
|
||
COPY . /foxess-mqtt | ||
WORKDIR /foxess-mqtt | ||
RUN composer install; | ||
VOLUME /foxess-mqtt/data | ||
CMD ["/foxess-mqtt/run.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,37 @@ | ||
# Horwoods Foxess Cloud Data collector | ||
|
||
This is a very simple tool to get the data out of foxesscloud and into MQTT, it has some very rough edges. | ||
This is a very simple tool to get the data out of FoxEss-cloud and into MQTT, it has some very rough edges. | ||
|
||
## Running | ||
|
||
```bash | ||
docker run --name foxescloud \ | ||
-e MQTT_HOST=192.168.0.2 \ | ||
-e MQTT_USERNAME=homeassistant \ | ||
-e MQTT_PASSWORD=ASecurePassword \ | ||
-e FOXESS_USERNAME=foxAccount \ | ||
-e FOXESS_PASSWORD=foxPassword \ | ||
-e DEVICE_ID=a-b-d-c-d \ | ||
-e - TIMEZONE=Europe/London \ | ||
-v /home/user/foxess_data:/foxess-mqtt/data \ | ||
mhzawadi/foxess-mqtt | ||
``` | ||
|
||
## Docker environment variables | ||
|
||
- MQTT_HOST the host or IP of your MQTT server | ||
- MQTT_USERNAME - the username for MQTT | ||
- MQTT_PASSWORD - the password for MQTT | ||
- FOXESS_USERNAME - your Foxess Cloud login | ||
- FOXESS_PASSWORD - your Foxess Cloud login | ||
- DEVICE_ID - the UUID that can be found on foxesscloud in the url path on the Inverter Details page. | ||
- Please make sure that this is exact value from inverter details page address between = and & character: | ||
- TIMEZONE - This is the time your in, else use UTC [List of Supported Timezones](https://www.php.net/manual/en/timezones.php) | ||
|
||
## Config file | ||
|
||
The new PHP script uses json for the config, | ||
you can copy the below code and paste into config.josn or run the image and wait for it spit out the files. | ||
|
||
`device_id` - the UUID that can be found on FoxEss-cloud in the url path on the Inverter Details page. | ||
Please make sure that this is exact value from inverter details page address between = and & character: | ||
|
||
The json for the config.json file | ||
``` | ||
{ | ||
"foxess_username": "username", | ||
"foxess_password": "secretPassword", | ||
"device_id": "device_id", | ||
"mqtt_host": "mosquitto", | ||
"mqtt_port": "1883", | ||
"mqtt_user": "foxess", | ||
"mqtt_pass": "foxess" | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "mhzawadi/foxess-mqtt", | ||
"description": "Foxess Cloud data to MQTT", | ||
"license": "MIT", | ||
"keywords": ["foxess","mqtt"], | ||
"authors": [ | ||
{ | ||
"name": "Matthew Horwood", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"require" : { | ||
"php-mqtt/client" : "*" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "9.5.*" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"MHorwood\\foxess_mqtt\\": "src", | ||
"MHorwood\\loader\\": "." | ||
} | ||
} | ||
} |
Oops, something went wrong.