Saturday, July 31, 2021

My rechargeable portable mosquito killer lamp

I had bought a few units of the electronic UV light type of mosquito trap before. They were functioning well in trapping and killing mosquitoes.

Unfortunately, after one to two years of usage, all of them became problematic and unable to function well. The problems faced are:

  • In some units, the LED lights became dimmer and dimmer, until no longer able to attract the mosquitoes.
  • In some units, the LED totally unable to turn on.
  • In some units, the fan became noisier and noisier, causing it to be an annoyance itself, particularly during the silent night.
  • In some units, the fan totally not rotating, and therefore unable to trap the mosquitoes.
This time, I decided to buy the electrocute type, at almost the same price as the previous suction type. It looks like this:

The lamp has a similar bluish lamp to attract the mosquitoes and insects to fly towards it. Surrounding the lamp are metal wires with electricity current to electrocute the insects. At the outer layer, there is a plastic cage to prevent ourselves from accidentally touch on the metal wires.

The plastic cage is easily removable for us to clean up the dead body of insects at the metal wires. There is a small brush that comes together with the lamp for this cleaning purpose.

This type of lamp comes with 3 different models:
  • Without a rechargeable battery, that needs to be always connected to a USB charging source in order to work.
  • With 2000 mAh rechargeable battery. When fully charged, the lamp can work for up to 8 hours without connecting to a power source.
  • With 4000 mAh rechargeable battery. When fully charged, the lamp can work for up to 16 hours without connecting to a power source.
There is a switch for you to turn on and turn off the light. In fact, the switch has 2 ON positions. The upper position turns on the blueish mosquito attraction light, and the lower position turns on a warm white reading light.

At the base of the lamp, there is a hanger to hang it in an upside-down position. So it is flexible to be put on tabletop, or be hung up in the air.

Its rechargeable feature is in fact very useful, especially for the following situations:
  • You can put it up and running anywhere, even in a place without a power source.
  • It can still function well during the time of electricity blackout. That is also the time you are likely to get more mosquitoes disturbance since your fan and air-cond are not functioning.
  • You can use it as an emergency light during electricity blackout.
  • You can use it during camping, as a dual function light in your camp.

Wednesday, July 28, 2021

My Roborock S7 hybrid vacuum and mop robot cleaner

Finally, I have retired my 4 years old Neato XV-11 robotic vacuum cleaner and replaced it with a new Roborock S7 which has both vacuum and mop function.


The Roborock S7 is currently selling at the price of RM2xxx. You should be able to get it at a lower price of RM2,099 during certain online promotion period. It is slightly more expensive than Roborock S6 MaxV.

The main differences of Roborock S7 from its previous versions including:
  • It is the first, and currently the only, Roborock model that supports Roborock auto empty dock. Anyhow, the Roborock auto empty dock is sold separately, and the price is quite high too.
  • It comes with Roborock's new innovation in vibration mopping technology that can scrub the floor at up to 3,000 cycles per minute, to be more effectively remove dried and stubborn stains on the floor.
  • It comes with new VibraRise technology, which, when it's ultrasonic sensor accurately detects a carpet underneath, it will automatically lift up its mopping cloth so that not to wet up the carpet, at the same time able to increase its vacuum suction power to clean up the carpet area.
However, the Roborock S7 does not come with A.I. cameras as in Roborock S6 MaxV, therefore missing the function of being able to "see" and avoid obstacles that block its path.
Roborock S7 can be configured and controlled using the Roborock mobile app, and also with your favourite voice assistant such as Google Assistant, Amazon Alexa, Apple Siri, Tmall Genie (天猫精灵), Xiaomi Xiaoai Classmate (小爱同学), etc. You can even control it using Xiaomi Mi Home app too.

One thing I like is that Roborock supports multilingual, although it can only use one language at a time. It will report its status with voice using your preferred language, which can be English, Chinese, Deutsch, Espanol, Francais, Italiano, Russian, Hebrew, Polski, Portugues, Ramana, Turk, Thai, Viet, Indonesian, Malay, etc.

Before start using it, you will need to connect Roborock S7 to your home WiFi, which in turn connected to the Internet. The Roborock mobile app in your handphone is able to auto-detect the Roborock robot cleaner nearby, and push your home WiFi settings to the robot.

Roborock S7 only support 2.4GHz WiFi up to Wireless-N. The 5Ghz WiFi and WiFi 6 are not supported. Anyhow, the 2.4GHz WiFi has the longest reaching range among them, and this is crucial for the Roborock S7 to get connected in order to work properly.

Roborock uses LiDAR navigation technology to scan and map your house. The map is stored in the cloud under your own Roborock account. You can share your robot with other Roborock users, and once shared, they will have access to your robot settings including the maps too.

You can also install Roborock app in multiple mobile devices and login with the same account, and all of them will have synchronized robot settings and information.

Roborock S7 supports multi-level mapping. Up to 4 maps can be stored for each robot.

The floor map of your house will be automatically drawn with LiDAR navigation during its first usage, and it is pretty accurate. The carpet area(s) are also identified and marked in the map.

After the map is drawn and saved, you can separate it into different rooms, or to merge rooms into larger one. You can configure it so that different room can have different intensity of cleaning and/or mopping.

As one of the standard features, you can draw virtual wall(s) on the map to prevent the robot from crossing over. You can also define certain area(s) on the map, such as your toilet or staircase, as no-go zone. You can also specify certain area(s) to be vacuum only without mopping (the no-mop zone).

This way of setting blockage to the robot using software configuration is much more better and much convenient than my Neato XV-11 way of using physical magnetic stripes.

Roborock S7 supports 4 levels of vacuum power, 4 levels of mopping scrub intensity, and 2 levels of mopping route. This enable you to ask the robot to clean more thoroughly in certain areas, such as the dining room and kitchen area, than the rest of your house.

Another standard feature is scheduling for its cleaning routine. It is fully customizable, as shown in the screenshot below.

Roborock keeps its cleaning history in the app. You can see its entire cleaning path and time taken in the history. This assure you that the cleaning was done properly and according to your instruction.

The Roborock app has a section to show the estimated time remaining for the replacement of wear-and-tear parts of the robot, as well as the time for upcoming maintenance, such as cleaning its sensors to upkeep its performance.

The Roborock app even comes with manual remote control function, for you to drive and control the robot like a remote control car, to move it to your preferred location. There are even 2 different modes of remote control - buttons and joystick.

Just like other cleaning robots, although the Roborock can help you to do automated floor cleaning, it is not the set-and-forget type. There are still 3 items that you need to periodically do, namely:
  • To take out its mopping cloth and wash it, then put it back. This should be done after every mopping.
  • To take out its dustbin box and empty it. Wash and then put it back. This should be done when the dustbin box is about to be fully filled up.
  • To take out its water tank and wash it. Refill with water and put it back. The water tank should be able to supply water for 2-3 times mopping of a typical terrace house.
If you have purchased the Roborock auto empty dock, then the dock will handle the job of emptying the dustbin box for you. You just need to replace the dust bag of the auto empty dock every few weeks.

One thing I dislike is that this Roborock S7 only comes with one mopping cloth. I would suggest you to buy a few more mopping clothes for changing, so that you have more time to do the washing and drying.

Note that the mopping cloth of Roborock S7 is different from the mopping cloth used in older versions - S6 MaxV, S6, S5 Max, etc. This is because of the new vibration mopping function. As such, make sure you buy the correct mopping cloth for Roborock S7 to be compatible with its base.

Monday, July 12, 2021

MySQL - How to insert record if not exists to avoid data duplication

While coding an application with MySQL as database, you might come into this situation:

You want to insert a new record into a table, if and only if there is no existing record in the table with certain matching fields.

  • The matching field(s) need not has a unique constrain in your table structure design.
  • Your insert statement does not include value definition for the table's autoincremented primary key (the "id"). As usual, you just let the database engine to determine the value of the autoincremented field for you upon successful insert action.
  • You only want to check for duplication in certain field(s). The rest of the fields can be the same or different. Meanings, as long as all those fields you want to check are completely matching, it is considered a duplicated record, regardless the rest of the fields are matching or not.
  • In the event you have found a duplication, you just want to do nothing and skip the insert. This is different from another situation whereby you want to update the existing record with current one.
  • You don't want to mess up with the primary key (the "id") sequence. Meanings, if there is a match, you just abort the insert action without touching the table. The "id" sequence can continue with next insert, without jumping autoincrement number.
and here is an example of the SQL statement, with value fed by PHP variables:

INSERT INTO `payment` (`year`,`month`,`item`,`category`,`type`,`account_no`,`date_due`,`value`,`payment_mode`,`paid_by`,`status`,`owner`,`payer`) SELECT $year,$month,'$item',$category,'$type','$account_no','$date_due',$value,$payment_mode,$payment_option,'$status',$owner,$payer FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `payment` WHERE `year`=$year AND `month`=$month AND `item`='$item' AND `type`='$type' AND `date_due`='$date_due' LIMIT 1)

The table structure for payment is as below:

In the example above, you match on fields year, month, item, type and date_due in the table payment. Your insert statement will be executed if the select statement return no result, i.e. there is no matching record(s) fulfilling the search criteria.

Thursday, July 8, 2021

My Huawei Scale 3 body analyzer scale

I've purchased the Huawei Scale 3 body analyzer scale at the price of RM99 directly from Huawei Online Store during their recent online promotion. The RRP of this scale is RM149 during normal days.

This scale is operated by 4 AAA size batteries. When used by a single person daily, the batteries can last for about a year. When used by the whole family, they can probably last for about 6 months.

Beside body weight, this scale can also measure body mass based on bioelectrical impedance analysis. It can also measure our heart rate (a.k.a. pulse rate).
In order to get accurate measurements, you need to step your feet on top of its 4 ITO electrodes, and wait for the 3 readings showing on its surface by turn respectively.

Before using the scale, you need to pair it with the Huawei Health app in your smartphone, which you can download from either Huawei AppGallery, Google Play Store or iTunes AppStore. It is the same Huawei Health app that connect with Huawei smart watch, smart band, heart rate monitor, and other supported wearable devices by Huawei or Honor.

You need to use Bluetooth to do the initial pairing. The scale should be able to autodetected by the latest version of Huawei Health. After that, you can add in WiFi pairing.

With WiFi pairing, your scale can actually send the measurement data to the cloud, and then sync to your handphone that is connected to the Internet, regardless of the location of your handphone.

You can share your scale with up to 10 smartphones, each installed with Huawei Health respectively.

The scale can be shared with up to 10 users, such as your family members, each will have individual historical records, and the scale is intelligent enough to identify the right person based on past record readings.

In the event 2 or more persons are having similar weight, body mass index (BMI) and body fat rate readings, the app will ask you to identify the right person for the measuring records.

There is also a guest measurement feature to let anyone to use the scale and get the measuring and analysis result with your handphone, without saving the data as historical record. In this way, you can share your scale with your guest visitors too.

The app will need you to provide your correct gender, age (calculated from date of birth) and height information, in order for its Trufit body composition analysis algorithm that is based on big data and A.I. to provide you with more than 10 body indicators.

The indicators available are:
  • Weight
  • BMI
  • Body fat rate
  • Skeletal muscle mass
  • Visceral fat
  • Basal metabolic rate
  • Body water percentage
  • Bone mineral content
  • Protein percentage
  • Fat-free mass
  • Heart rate
Each of the indicators has own analysis and explanation screen to explain what are them in layman terms.

The app can also show you whether your weight, BMI and heart rate are respectively low, normal, slightly high or high.

Under the Body Composition section, it shows you the composition of your weight in kilograms, breakdown by water content, protein, fat, and bone mineral content.

Note that Huawei TruFit function is currently only available for adults between the age of 18 to 65. If you are under 18 or over 65, you can only get 3 results from the scale, which are your weight, BMI and your heart rate.

You can also set a goal in the app to achieve your desired weight. The app will inform you how far is your weight from your goal, and congratulate you once you've achieved your goal.

Hint: Click on the "Older Posts" link to continue reading, or click here for a listing of all my past 3 months articles.