Posts

Showing posts with the label php

Domoticz : How to control Somfy Devices

Image
Background In a previous article , I demonstrated how to control Somfy devices using php and the Somfy API. Now that it's working, we need to identify some useful activities related to this new functionality. Why not begin integrating it into a Home Automation platform like Domoticz? Let's dive into it.

Somfy : How to control your devices in Php ?

Image
Background I recently bought a pergola with solar blinds, dimmable LEDs and a orientable roof blades. This is great to enjoy the summer without getting too much hot air or direct sun. It is coming with a Somfy Tahoma controller box that allows controlling the different devices with a SmartPhone. How cool is this ? Ok, but how does it work ? Can I control this myself with my own scripts and integrate it into an home automation system ? Let's have a look !

Rubrik : Updating Framework with Token auth

Image
Background I've spent few years creating PhP functions to help with my script journey, but since few releases, Rubrik is pushing to switch the API auth to service account and tokens which means many of my functions are about to die. It was a massive work, I do not want to lose the benefit of it.

Domoticz : How to record Water Usage

Image
Background I like home automation and home improvement. One way to become more sustainable is to measure various home consumption (electricity, water, heating, ...). Then, base on the numbers, you can act appropriately and improve the overall figures. Recently, I have created a IoT device to measure and record my solar production, this time we will have a look at the water usage.

ServerCheck : Get the Sensor value from CLI

Image
Background I'm monitoring the temperature in the datacenter with sensors from ServerCheck . They are reliable and very efficient. They support SNMP and have a comprehensive UI. But, I recently had the need to get the value of one sensor from the CLI. I noticed the company has been renamed to InfraSensing, but the hardware is still the same. Let's see what can be done !

Wallbox : API Episode 3

Image
Background I've received some very positive messages related to my posts about the Wallbox API. This is very rewarding and I would like to thank all the people who are reaching out 🙏🏻. In the comments, I've see people asking for API to restart the unit remotely. Since API only limit is the sky, let's see what can be done.

Rubrik : How to run a script with 2FA enabled

Image
Background Recently, Rubrik is enforcing the 2FA authentication (Multi Factor Authentication). This is a great security feature that minimizes the risk of unauthorized access to your environment. But how does it work within a script ? There is no way to enter a 2FA code when running a script every day at 2 am for example. The 2FA is enforced starting at CDM v 8.0.2 with a 3 month grace period to allow the customers to adjust their security.

Domoticz : Monitor Solar Panels Production (Part 3)

Image
Background Since the lovely box is now created , let's see how we can improve the reporting. ThingSpeak and MATLAB cannot provide me with the relevant reporting - simply because I need time to learn how it works and honestly, I have something else in mind. I have a home automation platform at home called Domoticz, may be I can get something out of it !

Wallbox : API Episode 2

Image
Background In the previous episode about "using API and Wallbox", we have seen some interesting ways to interact with the charger. In this episode, the goal is to add some more practical examples. Indeed, if you are following my GitHub repo on this topic, I have added some functions for pausing, resuming the charging session as well as locking and unlocking the charger. Also, I can set the charging power to a certain number of Amps. Let's see this in action !

Wallbox : Get The Most Of It (with API)

Image
Background Two month ago, I got myself a PHEV (Plug In Hybrid Electric Vehicle) and of course, thinking at the future, I also installed a class-2 charger at home. The obvious choice to me was the Wallbox Pulsar Plus charger. Small form factor, easy to set up, affordable and reliable. Wallbox software offering is great : centralized statistics on their website, mobile app, ... everything. But, is there any API available ? ;)

Nutanix : Get Software Version for each Clusters

Image
Background When doing upgrade campaign, you need to go to each cluster to verify who's got what software version and then check the progress. Sometimes, it could be painful to collect that information, especially when you have a lot of clusters. I was wondering how this could automated, some obvious details can easy be obtained with "classic" API calls, but not everything. Challenge accepted!

Rubrik : Detect & Protect Unprotected VMs

Image
Background We came to a point where unprotected VMs can be out of sight and we could potentially miss protection on some important object. We do not want to apply a default protection at the top level of our infrastructure to avoid any uncomfortable storage usage. So what ? It would be nice to have a script running on a cluster and check what are the unprotected VM and apply an SLA ... mmmh let me think...

Rubrik : Automate Nutanix Cluster Configuration

Image
Background I would like to automate the Nutanix AHV cluster addition on my Rubrik appliances. Either for testing purpose or for more general deployments. In order to achieve this, you need to perform couple of actions and clicks in the UI. But since the Rubrik UI is API-First, of course, that should be doable via API call ? Isn't it ? But why limiting this to only adding new Cluster ? Let's see...

Rubrik : Using GraphQL

Image
Background Sending REST API calls to the cluster is sometimes slow and not very efficient. I came across some interesting posts on that topic. It looks like while REST is getting all the results (even the one you are not interested with) it exist another query type that only returns what you are looking for. This is GraphQL. Let's have a look !

Nutanix : Get List of Powered-off VMs (AHV)

Image
Background We have a quite large AHV infrastructure and sometimes this is not always easy to get all the relevant details to improve/maintain it. Don't get me wrong, Prism Central is helping a lot. But, when it comes to optimisation of the assets, it is hard to see what gains we can make - starting by detecting the powered off VMs.

Nutanix : Get Size of AHV Snapshots

Image
Background While working on a AHV cluster, you can notice that, with time, the storage decreases. This is obvious, all VMs are using thin-provisioning by default. Doing some cleanup and maintenance is required on every IT systems and Nutanix does not escape the rule. One area where we are not focusing enough is the snapshots we are creating and most of the time forgot !

Php : Easy Documentation Generator

Image
Background We all been there, and probably me first. When creating codes, the documentation consist most of the time by the comments in the codes ... *sic* For small projects by couple of hundreds lines this is ok but when your project start to hits some 10 thousand lines, this is becoming an issue. There are multiple of initiative on the market to help generating proper documentation (phpDocumentor, phpDox, ....). But they are all massive and not intuitive. I decided to create something ultra simple providing a php source file containing all your function, and an output file that will generating markdown syntax. Ideal for GitHub.

Php : Rotating Log Files

Image
Background A long time ago, I was in a plane for more than 10 hours and I had to utilize that time efficiently. I decided to open my laptop and start coding. But, while being off-net for a long period of time, I had no distraction and started to think. I was creating an application that was generating a lot of logs and I thought important to keep them in an efficient way. This is why log rotation came to mind.

Rubrik : Get VM Specs from a Snapshot

Image
Background     I did a mistake - we all do - I have changed the specs on the wrong VMs and of course I did not recall the original settings. I thought I could get them from my backup since all these details are retained when we need to export the VM. Ok, but how ?

Docker : Rubrik Central - Docker Edition!

Image
Background After publishing my post about Rubrik Central  months ago, I have received comments saying that it is too difficult to deploy and has too many pre-requisites. I thought about automating the deployment process in many ways and found that containers could be a nice option. But I didn't know anything about Docker. So, I did some research and I think I came across with something definitely usable !